Search in sources :

Example 1 with CompositeMultiImageDescriptor

use of com.archimatetool.editor.ui.components.CompositeMultiImageDescriptor in project archi by archimatetool.

the class ImageFactory method getCompositeImageDescriptor.

/**
 * Return a composite image consisting of many images
 *
 * @param imageNames
 * @return
 */
public CompositeImageDescriptor getCompositeImageDescriptor(String[] imageNames) {
    // Make a registry name, cached
    // $NON-NLS-1$
    String key_name = "@";
    for (String name : imageNames) {
        key_name += name;
    }
    ImageRegistry registry = fPlugin.getImageRegistry();
    CompositeImageDescriptor cid = (CompositeImageDescriptor) registry.getDescriptor(key_name);
    // Make it and cache it
    if (cid == null) {
        ImageDescriptor[] desc = new ImageDescriptor[imageNames.length];
        for (int i = 0; i < imageNames.length; i++) {
            desc[i] = getImageDescriptor(imageNames[i]);
        }
        cid = new CompositeMultiImageDescriptor(desc);
        registry.put(key_name, cid);
    }
    return cid;
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) CompositeImageDescriptor(org.eclipse.jface.resource.CompositeImageDescriptor) CompositeImageDescriptor(org.eclipse.jface.resource.CompositeImageDescriptor) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) CompositeMultiImageDescriptor(com.archimatetool.editor.ui.components.CompositeMultiImageDescriptor) CompositeMultiImageDescriptor(com.archimatetool.editor.ui.components.CompositeMultiImageDescriptor)

Aggregations

CompositeMultiImageDescriptor (com.archimatetool.editor.ui.components.CompositeMultiImageDescriptor)1 CompositeImageDescriptor (org.eclipse.jface.resource.CompositeImageDescriptor)1 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)1 ImageRegistry (org.eclipse.jface.resource.ImageRegistry)1