| org.eclipse.ui.internal.commands.ICommandImageService
All known Subclasses: org.eclipse.ui.internal.commands.CommandImageService,
ICommandImageService | public interface ICommandImageService extends IDisposable(Code) | |
Provides a look-up facility for images associated with commands.
The type of an image indicates the state of the associated command
within the user interface. The supported types are: TYPE_DEFAULT
(to be used for an enabled command), TYPE_DISABLED (to be used
for a disabled command) and TYPE_HOVER (to be used for an
enabled command over which the mouse is hovering).
The style of an image is an arbitrary string used to distinguish
between sets of images associated with a command. For example, a command may
appear in the menus as the default style. However, in the toolbar, the
command is simply the default action for a toolbar drop down item. As such,
perhaps a different image style is appropriate. The classic case is the "Run
Last Launched" command, which appears in the menu and the toolbar, but with
different icons in each location.
This interface should not be implemented or extended by clients.
PROVISIONAL. This class or interface has been added as
part of a work in progress. There is a guarantee neither that this API will
work nor that it will remain the same. Please do not use this API without
consulting with the Platform/UI team.
This class is eventually intended to exist in
org.eclipse.ui.commands .
since: 3.2 |
Field Summary | |
final public static int | TYPE_DEFAULT The type of image to display in the default case. | final public static int | TYPE_DISABLED The type of image to display if the corresponding command is disabled. | final public static int | TYPE_HOVER The type of image to display if the mouse is hovering over the command
and the command is enabled. |
Method Summary | |
public void | bind(String commandId, int type, String style, ImageDescriptor descriptor) Binds a particular image descriptor to a command id, type and style
triple
Parameters: commandId - The identifier of the command to which the image should bebound; must not be null . Parameters: type - The type of image to retrieve. | public void | bind(String commandId, int type, String style, URL url) Binds a particular image path to a command id, type and style triple
Parameters: commandId - The identifier of the command to which the image should bebound; must not be null . Parameters: type - The type of image to retrieve. | public String | generateUnusedStyle(String commandId) Generates a style tag that is not currently used for the given command.
This can be used by applications trying to create a unique style for a
new set of images.
Parameters: commandId - The identifier of the command for which a unique style isrequired; must not be null . | public ImageDescriptor | getImageDescriptor(String commandId) Retrieves the default image associated with the given command in the
default style.
Parameters: commandId - The identifier to find; must not be null . | public ImageDescriptor | getImageDescriptor(String commandId, int type) Retrieves the image of the given type associated with the given command
in the default style.
Parameters: commandId - The identifier to find; must not be null . Parameters: type - The type of image to retrieve. | public ImageDescriptor | getImageDescriptor(String commandId, int type, String style) Retrieves the image of the given type associated with the given command
in the given style.
Parameters: commandId - The identifier to find; must not be null . Parameters: type - The type of image to retrieve. | public ImageDescriptor | getImageDescriptor(String commandId, String style) Retrieves the default image associated with the given command in the
given style.
Parameters: commandId - The identifier to find; must not be null . Parameters: style - The style of the image to retrieve; may be null . | public void | readRegistry()
Reads the command image information from the registry. |
TYPE_DEFAULT | final public static int TYPE_DEFAULT(Code) | | The type of image to display in the default case.
|
TYPE_DISABLED | final public static int TYPE_DISABLED(Code) | | The type of image to display if the corresponding command is disabled.
|
TYPE_HOVER | final public static int TYPE_HOVER(Code) | | The type of image to display if the mouse is hovering over the command
and the command is enabled.
|
bind | public void bind(String commandId, int type, String style, ImageDescriptor descriptor)(Code) | | Binds a particular image descriptor to a command id, type and style
triple
Parameters: commandId - The identifier of the command to which the image should bebound; must not be null . Parameters: type - The type of image to retrieve. This value must be one of theTYPE constants defined in this class. Parameters: style - The style of the image; may be null . Parameters: descriptor - The image descriptor. Should not be null . |
bind | public void bind(String commandId, int type, String style, URL url)(Code) | | Binds a particular image path to a command id, type and style triple
Parameters: commandId - The identifier of the command to which the image should bebound; must not be null . Parameters: type - The type of image to retrieve. This value must be one of theTYPE constants defined in this class. Parameters: style - The style of the image; may be null . Parameters: url - The URL to the image. Should not be null . |
generateUnusedStyle | public String generateUnusedStyle(String commandId)(Code) | | Generates a style tag that is not currently used for the given command.
This can be used by applications trying to create a unique style for a
new set of images.
Parameters: commandId - The identifier of the command for which a unique style isrequired; must not be null . A style tag that is not currently used; may be null . |
getImageDescriptor | public ImageDescriptor getImageDescriptor(String commandId)(Code) | | Retrieves the default image associated with the given command in the
default style.
Parameters: commandId - The identifier to find; must not be null . An image appropriate for the given command; may benull . |
getImageDescriptor | public ImageDescriptor getImageDescriptor(String commandId, int type)(Code) | | Retrieves the image of the given type associated with the given command
in the default style.
Parameters: commandId - The identifier to find; must not be null . Parameters: type - The type of image to retrieve. This value must be one of theTYPE constants defined in this interface. An image appropriate for the given command; null if the given image type cannot be found. |
getImageDescriptor | public ImageDescriptor getImageDescriptor(String commandId, int type, String style)(Code) | | Retrieves the image of the given type associated with the given command
in the given style.
Parameters: commandId - The identifier to find; must not be null . Parameters: type - The type of image to retrieve. This value must be one of theTYPE constants defined in this interface. Parameters: style - The style of the image to retrieve; may be null . An image appropriate for the given command; null if the given image style and type cannot be found. |
getImageDescriptor | public ImageDescriptor getImageDescriptor(String commandId, String style)(Code) | | Retrieves the default image associated with the given command in the
given style.
Parameters: commandId - The identifier to find; must not be null . Parameters: style - The style of the image to retrieve; may be null . An image appropriate for the given command; null if the given image style cannot be found. |
readRegistry | public void readRegistry()(Code) | |
Reads the command image information from the registry. This will
overwrite any of the existing information in the command image service.
This method is intended to be called during start-up. When this method
completes, this command image service will reflect the current state of
the registry.
|
|
|