UI Toolkit classes

To make handling graphic resources more uniform and convenient when you develop plug-ins, the UI Toolkit offers a set of framework functions. These functions are available with the com.tssap.util.ui.image package. They combine an interface and some classes for accessing graphic resources from different sources:

 

ISapSharedImages

 

This interface is derived from org.eclipse.ui.ISharedImages and allows you to access registry constants directly from the central icon repository in the Eclipse Workbench. ISharedImages thus provides a registry for all the icons used in the Workbench plug-in. It makes sense to allow other plug-ins to access these icons, since they are standard icons intended for use when you create project resources (such as projects, files, and folders). ISharedImages stipulates the two methods getImage() and getImageDescriptor() for the implementing classes. To connect the image registry with the Workbench plug-ins, the ISapSharedImages interface is implemented by the toolkit class SapSharedImages.

 

SapIdeUtilImages

 

This central utility class implements several methods that return either image descriptors or SWT images for direct display in the UI. You can access a method from this class whether you are using Workbench icons from the Eclipse standard, SAP standard icons, or your graphics from a specific plug-in.

 

SapSharedImages

 

The implementation of this class connects the image registry belonging to the Workbench plug-ins. This guarantees that resource management is optimized using a share and pool mechanism, which is particularly effective if graphics are used often in a plug-in. This has two advantages: Firstly, the same graphic can be used in different places in the UI, and secondly, resources that are not needed can be placed in a global pool and reused as necessary.

 

ISapImage

 

This interface is used for creation and management of SAP images. As basic integral part each image resource contains a plug-in ID and the file path information. When creating a new image the physical resource is searched for the /icons directory in the specified file path of the given plug-in. ISapImage prescribes a set of methods that are used to retrieve the file path, the file name, the plug-in ID or the image ID.

 

SapImage

 

This auxiliary class implements the ISapImage interface and defines constants for SAP standard icons. These constants are used to access icon resources. The physical storage location is referenced and short texts are stored in the definition of the constant.

This class is used by the method SapIdeUtilImage.getSapImage(), which needs parameters to access the resource pool of SAP standard icons using constant names.

Morever SapImage implements protected constructors that allows sub classes to pass parameters for the plug-in ID or the file path just when creating an image instance.

Each image instance created with the SapImage is automatically stored in image registry.

 

 

Relationships between classes