|
COSMOS ${releaseVersion} resource-modeling Project Internal API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.cosmos.rm.smlif.internal.editor.ImageManager
public abstract class ImageManager
Manages the images and image descriptors implementing an efficient cache. This
implementations caches these objects in a ImageRegistry
instance.
Before using an instance of this class it is necessary to invoke the
#initialize() method.
| Field Summary | |
|---|---|
static java.lang.String |
T_LCL
|
static java.lang.String |
T_OBJ
|
static java.lang.String |
T_OVR
|
static java.lang.String |
T_TOOL
|
static java.lang.String |
T_VIEW
|
static java.lang.String |
T_WIZBAN
|
| Constructor Summary | |
|---|---|
ImageManager()
|
|
| Method Summary | |
|---|---|
protected boolean |
add(java.lang.String key,
org.eclipse.jface.resource.ImageDescriptor imageDescriptor)
Adds an image descriptor to this image manager. |
protected org.eclipse.jface.resource.ImageDescriptor |
add(java.lang.String prefix,
java.lang.String name)
Creates an image descriptor for a given image directory prefix and image name adding it to the image registry. |
protected org.eclipse.jface.resource.ImageDescriptor |
add(java.lang.String prefixType,
java.lang.String prefix,
java.lang.String name)
Creates an image descriptor for a given image directory prefix, directory type and image name adding it to the image registry. |
protected abstract void |
addImages()
Subclasses are supposed to add all the images to this manager in this method implementation. |
protected void |
checkImages()
Checks if the images are loaded in the cache. |
protected org.eclipse.jface.resource.ImageDescriptor |
createImageDescriptor(java.lang.String prefix,
java.lang.String name)
Creates an image descriptor for a given image directory prefix and image name. |
org.eclipse.swt.graphics.Image |
getImage(java.lang.String key)
Returns the image associated to a key. |
org.eclipse.swt.graphics.Image |
getImage(java.lang.String prefixType,
java.lang.String key)
Returns the image associated to a prefix type and key. |
org.eclipse.jface.resource.ImageDescriptor |
getImageDescriptor(java.lang.String key)
Returns the image descriptor associated to a key. |
org.eclipse.jface.resource.ImageDescriptor |
getImageDescriptor(java.lang.String prefixType,
java.lang.String key)
Returns the image descriptor associated to a prefix type and key. |
void |
initialize(java.net.URL iconBaseURL,
org.eclipse.jface.resource.ImageRegistry imageRegistry)
Initializes this image manager. |
static void |
initializeImages(ImageManager imageManager,
org.eclipse.ui.plugin.AbstractUIPlugin uiPlugin)
|
boolean |
isInitialized()
Indicates whether this image manager was initialized. |
protected java.net.URL |
makeIconFileURL(java.lang.String prefix,
java.lang.String name)
Creates a URL for a given image directory prefix and image name. |
void |
setImageDescriptors(org.eclipse.jface.action.IAction action,
java.lang.String name)
Sets all the image descriptors of a given action. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String T_LCL
public static final java.lang.String T_TOOL
public static final java.lang.String T_VIEW
public static final java.lang.String T_OBJ
public static final java.lang.String T_OVR
public static final java.lang.String T_WIZBAN
| Constructor Detail |
|---|
public ImageManager()
| Method Detail |
|---|
public void initialize(java.net.URL iconBaseURL,
org.eclipse.jface.resource.ImageRegistry imageRegistry)
This method is not supposed to be invoked more than once.
iconBaseURL - The url to the plugin's icon base directory.imageRegistry - The image registry to cache the images and image
descriptors.protected void checkImages()
imagesWereLoaded is used to ensure that they won't
be loaded more then once.
protected abstract void addImages()
The images should be added by invoking one the add
methods.
protected org.eclipse.jface.resource.ImageDescriptor add(java.lang.String prefix,
java.lang.String name)
prefix - name -
protected org.eclipse.jface.resource.ImageDescriptor add(java.lang.String prefixType,
java.lang.String prefix,
java.lang.String name)
This method is typically used to register action images. For example, to register clcl16/open.gif, dlcl16/open.gif and elcl16/open.gif client should execute
addManaged("c", T_LCL, "open.gif"),
add("d", T_LCL, "open.gif") and
add("e", T_LCL, "open.gif").
prefixType - prefix - name -
protected boolean add(java.lang.String key,
org.eclipse.jface.resource.ImageDescriptor imageDescriptor)
throws java.lang.IllegalArgumentException
key - imageDescriptor -
true if the image descriptor was added of false
if key or imageDescriptor is null or if the
default image registry has already the specified key.
java.lang.IllegalArgumentException - if the key already exists
protected org.eclipse.jface.resource.ImageDescriptor createImageDescriptor(java.lang.String prefix,
java.lang.String name)
base icon url
prefix - name -
protected java.net.URL makeIconFileURL(java.lang.String prefix,
java.lang.String name)
throws java.net.MalformedURLException
prefix - name -
java.net.MalformedURLExceptionpublic org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(java.lang.String key)
key -
public org.eclipse.swt.graphics.Image getImage(java.lang.String key)
key -
public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(java.lang.String prefixType,
java.lang.String key)
prefixType - key -
public org.eclipse.swt.graphics.Image getImage(java.lang.String prefixType,
java.lang.String key)
prefixType - key -
public void setImageDescriptors(org.eclipse.jface.action.IAction action,
java.lang.String name)
action - name -
public static void initializeImages(ImageManager imageManager,
org.eclipse.ui.plugin.AbstractUIPlugin uiPlugin)
public boolean isInitialized()
|
COSMOS ${releaseVersion} resource-modeling Project Internal API Specification |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||