Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.ui.help
Class WorkbenchHelp

    java.lang.Object
      org.eclipse.ui.help.WorkbenchHelp

public class WorkbenchHelp
extends Object

Provides methods for accessing the help UI.

The help UI is optional, to allow applications to be configured without one.

The various `setHelp` methods allow context help to be hooked in to SWT menus, menu items, and controls, and into JFace actions. This involves furnishing a help context id. When the user requests help for one of the established widgets (for instance, by hitting F1), the context id is retrieved and passed to the help UI using `WorkbenchHelp.displayContext(helpContext, xposition, yposition)`.

In cases more dynamic situations, clients may hook their own help listener and call `WorkbenchHelp.displayContext` with an `IContext`.

This class provides static methods only; it is not intended to be instantiated or subclassed.

See Also:
  `HelpSystem`

Method Summary
`static HelpListener` | `createHelpListener(ICommand command)` Creates a new help listener for the given command.
`static void` | `displayContext(IContext context, int x, int y)` Displays context-sensitive help for the given context.
`static void` | `displayHelp()` Displays the entire help bookshelf.
`static void` | `displayHelp(IContext context)` Displays context-sensitive help for the given context.
`static void` | `displayHelp(String contextId)` Calls the help support system to display the given help context id.
`static void` | `displayHelpResource(String href)` Displays help content for the help resource with the given URL.
`static Object` | `getHelp(Control control)` Deprecated. as context computers are no longer supported
`static Object` | `getHelp(Menu menu)` Deprecated. as context computers are no longer supported
`static Object` | `getHelp(MenuItem menuItem)` Deprecated. as context computers are no longer supported
`static IHelp` | `getHelpSupport()` Deprecated. Use the static methods on this class and on `HelpSystem` instead of the IHelp methods on the object returned by this method.
`static boolean` | `isContextHelpDisplayed()` Returns whether the context-sensitive help window is currently being displayed.
`static void` | `setHelp(Control control, IContextComputer computer)` Deprecated. context computers are no longer supported, clients should implement their own help listener
`static void` | `setHelp(Control control, Object[] contexts)` Deprecated. use setHelp with single context id parameter
`static void` | `setHelp(Control control, String contextId)` Sets the given help context id on the given control.
`static void` | `setHelp(IAction action, IContextComputer computer)` Deprecated. context computers are no longer supported, clients should implement their own help listener
`static void` | `setHelp(IAction action, Object[] contexts)` Deprecated. use setHelp with a single context id parameter
`static void` | `setHelp(IAction action, String contextId)` Sets the given help context id on the given action.
`static void` | `setHelp(Menu menu, IContextComputer computer)` Deprecated. context computers are no longer supported, clients should implement their own help listener
`static void` | `setHelp(MenuItem item, IContextComputer computer)` Deprecated. context computers are no longer supported, clients should implement their own help listener
`static void` | `setHelp(MenuItem item, Object[] contexts)` Deprecated. use setHelp with single context id parameter
`static void` | `setHelp(MenuItem item, String contextId)` Sets the given help context id on the given menu item.
`static void` | `setHelp(Menu menu, Object[] contexts)` Deprecated. use setHelp with single context id parameter
`static void` | `setHelp(Menu menu, String contextId)` Sets the given help context id on the given menu.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### displayHelp

    public static void displayHelp()

  Displays the entire help bookshelf.

  Ignored if no help UI is available.

  Since:
    3.0

### displayContext

    public static void displayContext(IContext context,
                                      int x,
                                      int y)

  Displays context-sensitive help for the given context.

  (x,y) coordinates specify the location where the context sensitive help UI will be presented. These coordinates are screen-relative (ie: (0,0) is the top left-most screen corner). The platform is responsible for calling this method and supplying the appropriate location.

  Ignored if no help UI is available.

  Parameters:
    `context` - the context to display
    `x` - horizontal position
    `y` - verifical position
  Since:
    3.0

### displayHelpResource

    public static void displayHelpResource(String href)

  Displays help content for the help resource with the given URL.

  This method is called by the platform to launch the help system UI, displaying the documentation identified by the `href` parameter.

  The help system makes no guarantee that all the help resources can be displayed or how they are displayed.

  Ignored if no help UI is available.

  Parameters:
    `href` - the URL of the help resource.

    Valid href are as described in `IHelpResource.getHref()`

  Since:
    3.0

### createHelpListener

    public static HelpListener createHelpListener(ICommand command)

  Creates a new help listener for the given command. This retrieves the help context ID from the command, and creates an appropriate listener based on this.

  Parameters:
    `command` - The command for which the listener should be created; must not be `null`.
  Returns:
    A help listener; never `null`.

### displayHelp

    public static void displayHelp(String contextId)

  Calls the help support system to display the given help context id.

  May only be called from a UI thread.

  Parameters:
    `contextId` - the id of the context to display
  Since:
    2.0

### displayHelp

    public static void displayHelp(IContext context)

  Displays context-sensitive help for the given context.

  May only be called from a UI thread.

  Parameters:
    `context` - the context to display
  Since:
    2.0

### getHelp

    public static Object getHelp(Control control)

  Deprecated. as context computers are no longer supported

  Returns the help contexts on the given control.

  Instances of `IContextComputer` may use this method to obtain the previously registered help contexts of a control.

  Parameters:
    `control` - the control on which the contexts are registered
  Returns:
    contexts the contexts to use when F1 help is invoked; a mixed-type array of context ids (type `String`) and/or help contexts (type `IContext`) or an `IContextComputer` or `null` if no contexts have been set.

### getHelp

    public static Object getHelp(Menu menu)

  Deprecated. as context computers are no longer supported

  Returns the help contexts on the given menu.

  Instances of `IContextComputer` may use this method to obtain the previously registered help contexts of a menu.

  Parameters:
    `menu` - the menu on which the contexts are registered
  Returns:
    contexts the contexts to use when F1 help is invoked; a mixed-type array of context ids (type `String`) and/or help contexts (type `IContext`) or an `IContextComputer` or `null` if no contexts have been set.

### getHelp

    public static Object getHelp(MenuItem menuItem)

  Deprecated. as context computers are no longer supported

  Returns the help contexts on the given menu item.

  Instances of `IContextComputer` may use this method to obtain the previously registered help contexts of a menu.

  Parameters:
    `menuItem` - the menu item on which the contexts are registered
  Returns:
    contexts the contexts to use when F1 help is invoked; a mixed-type array of context ids (type `String`) and/or help contexts (type `IContext`) or an `IContextComputer` or `null` if no contexts have been set.

### getHelpSupport

    public static IHelp getHelpSupport()

  Deprecated. Use the static methods on this class and on `HelpSystem` instead of the IHelp methods on the object returned by this method.

  Returns the help support system for the platform, if available.

  Returns:
    the help support system, or `null` if none

### isContextHelpDisplayed

    public static boolean isContextHelpDisplayed()

  Returns whether the context-sensitive help window is currently being displayed. Returns `false` if the help UI has not been activated yet.

  Returns:
    `true` if the context-sensitive help window is currently being displayed, `false` otherwise

### setHelp

    public static void setHelp(IAction action,
                               Object[] contexts)

  Deprecated. use setHelp with a single context id parameter

  Sets the given help contexts on the given action.

  Use this method when the list of help contexts is known in advance. Help contexts can either supplied as a static list, or calculated with a context computer (but not both).

  Parameters:
    `action` - the action on which to register the computer
    `contexts` - the contexts to use when F1 help is invoked; a mixed-type array of context ids (type `String`) and/or help contexts (type `IContext`)

### setHelp

    public static void setHelp(IAction action,
                               IContextComputer computer)

  Deprecated. context computers are no longer supported, clients should implement their own help listener

  Sets the given help context computer on the given action.

  Use this method when the help contexts cannot be computed in advance. Help contexts can either supplied as a static list, or calculated with a context computer (but not both).

  Parameters:
    `action` - the action on which to register the computer
    `computer` - the computer to determine the help contexts for the control when F1 help is invoked

### setHelp

    public static void setHelp(Control control,
                               Object[] contexts)

  Deprecated. use setHelp with single context id parameter

  Sets the given help contexts on the given control.

  Use this method when the list of help contexts is known in advance. Help contexts can either supplied as a static list, or calculated with a context computer (but not both).

  Parameters:
    `control` - the control on which to register the contexts
    `contexts` - the contexts to use when F1 help is invoked; a mixed-type array of context ids (type `String`) and/or help contexts (type `IContext`)

### setHelp

    public static void setHelp(Control control,
                               IContextComputer computer)

  Deprecated. context computers are no longer supported, clients should implement their own help listener

  Sets the given help context computer on the given control.

  Use this method when the help contexts cannot be computed in advance. Help contexts can either supplied as a static list, or calculated with a context computer (but not both).

  Parameters:
    `control` - the control on which to register the computer
    `computer` - the computer to determine the help contexts for the control when F1 help is invoked

### setHelp

    public static void setHelp(Menu menu,
                               Object[] contexts)

  Deprecated. use setHelp with single context id parameter

  Sets the given help contexts on the given menu.

  Use this method when the list of help contexts is known in advance. Help contexts can either supplied as a static list, or calculated with a context computer (but not both).

  Parameters:
    `menu` - the menu on which to register the context
    `contexts` - the contexts to use when F1 help is invoked; a mixed-type array of context ids (type `String`) and/or help contexts (type `IContext`)

### setHelp

    public static void setHelp(Menu menu,
                               IContextComputer computer)

  Deprecated. context computers are no longer supported, clients should implement their own help listener

  Sets the given help context computer on the given menu.

  Use this method when the help contexts cannot be computed in advance. Help contexts can either supplied as a static list, or calculated with a context computer (but not both).

  Parameters:
    `menu` - the menu on which to register the computer
    `computer` - the computer to determine the help contexts for the control when F1 help is invoked

### setHelp

    public static void setHelp(MenuItem item,
                               Object[] contexts)

  Deprecated. use setHelp with single context id parameter

  Sets the given help contexts on the given menu item.

  Use this method when the list of help contexts is known in advance. Help contexts can either supplied as a static list, or calculated with a context computer (but not both).

  Parameters:
    `item` - the menu item on which to register the context
    `contexts` - the contexts to use when F1 help is invoked; a mixed-type array of context ids (type `String`) and/or help contexts (type `IContext`)

### setHelp

    public static void setHelp(MenuItem item,
                               IContextComputer computer)

  Deprecated. context computers are no longer supported, clients should implement their own help listener

  Sets the given help context computer on the given menu item.

  Use this method when the help contexts cannot be computed in advance. Help contexts can either supplied as a static list, or calculated with a context computer (but not both).

  Parameters:
    `item` - the menu item on which to register the computer
    `computer` - the computer to determine the help contexts for the control when F1 help is invoked

### setHelp

    public static void setHelp(IAction action,
                               String contextId)

  Sets the given help context id on the given action.

  Parameters:
    `action` - the action on which to register the context id
    `contextId` - the context id to use when F1 help is invoked
  Since:
    2.0

### setHelp

    public static void setHelp(Control control,
                               String contextId)

  Sets the given help context id on the given control.

  Parameters:
    `control` - the control on which to register the context id
    `contextId` - the context id to use when F1 help is invoked
  Since:
    2.0

### setHelp

    public static void setHelp(Menu menu,
                               String contextId)

  Sets the given help context id on the given menu.

  Parameters:
    `menu` - the menu on which to register the context id
    `contextId` - the context id to use when F1 help is invoked
  Since:
    2.0

### setHelp

    public static void setHelp(MenuItem item,
                               String contextId)

  Sets the given help context id on the given menu item.

  Parameters:
    `item` - the menu item on which to register the context id
    `contextId` - the context id to use when F1 help is invoked
  Since:
    2.0

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.