org.eclipse.graphiti.ui.platform
Class AbstractImageProvider

java.lang.Object
  extended by org.eclipse.graphiti.platform.AbstractExtension
      extended by org.eclipse.graphiti.ui.platform.AbstractImageProvider
All Implemented Interfaces:
IExtension, IImageProvider
Direct Known Subclasses:
PlatformImageProvider

public abstract class AbstractImageProvider
extends AbstractExtension
implements IImageProvider

The Class AbstractImageProvider. Instead of implementing IImageProvider directly the clients should extend this AbstractImageProvider. They can simply override the method addAvailableImages().


Field Summary
private  Hashtable<String,String> htKeyImage
           
private  String pluginId
           
 
Constructor Summary
AbstractImageProvider()
          Creates a new AbstractImageProvider.
 
Method Summary
protected abstract  void addAvailableImages()
          Add all available images with addImageFilePath(String imageId, String imageFilePath);
protected  void addImageFilePath(String imageId, String imageFilePath)
          Add image file path.
 String getImageFilePath(String imageId)
          This is a method simply returns the location of the image file in the plug-in.
 String getPluginId()
           
 void setPluginId(String pluginId)
          Sets the pluginId.
 
Methods inherited from class org.eclipse.graphiti.platform.AbstractExtension
getProviderId, setProviderId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.graphiti.platform.IExtension
getProviderId, setProviderId
 

Field Detail

pluginId

private String pluginId

htKeyImage

private Hashtable<String,String> htKeyImage
Constructor Detail

AbstractImageProvider

public AbstractImageProvider()
Creates a new AbstractImageProvider.

Method Detail

getPluginId

public final String getPluginId()
Specified by:
getPluginId in interface IImageProvider
Returns:
The pluginId of the plug-in containing the image files provided by this image-provider

setPluginId

public final void setPluginId(String pluginId)
Sets the pluginId.

Specified by:
setPluginId in interface IImageProvider
Parameters:
pluginId - The pluginId to set.

getImageFilePath

public final String getImageFilePath(String imageId)
Description copied from interface: IImageProvider
This is a method simply returns the location of the image file in the plug-in. The path is relative to the root of the plug-in. The path must not have a leading "." or path separator. Clients should use a path like "icons/mysample.gif" rather than "./icons/mysample.gif" or "/icons/mysample.gif".

Specified by:
getImageFilePath in interface IImageProvider
Returns:
imageFilePath the relative path of the image file, relative to the root of the plug-in; the path must be legal

addImageFilePath

protected final void addImageFilePath(String imageId,
                                      String imageFilePath)
Add image file path.

Parameters:
imageId - the image id
imageFilePath - the image file path

addAvailableImages

protected abstract void addAvailableImages()
Add all available images with addImageFilePath(String imageId, String imageFilePath);



Copyright (c) SAP AG 2005, 2012.