Search in sources :

Example 41 with ImageRegistry

use of org.eclipse.jface.resource.ImageRegistry in project erlide_eclipse by erlang.

the class ErlideUIDebugImages method initializeImageRegistry.

private static void initializeImageRegistry() {
    ErlideUIDebugImages.fgImageRegistry = new ImageRegistry(ErlideUIPlugin.getStandardDisplay());
    ErlideUIDebugImages.declareImages();
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry)

Example 42 with ImageRegistry

use of org.eclipse.jface.resource.ImageRegistry in project webtools.sourceediting by eclipse.

the class XSDEditorPlugin method getIcon.

public Image getIcon(String name) {
    try {
        ImageRegistry imageRegistry = getImageRegistry();
        if (imageRegistry.get(name) != null) {
            return imageRegistry.get(name);
        } else {
            // $NON-NLS-1$
            URL installURL = getDefault().getBundle().getEntry("/");
            // $NON-NLS-1$
            String imageString = "icons/" + name;
            URL imageURL = new URL(installURL, imageString);
            imageRegistry.put(name, ImageDescriptor.createFromURL(imageURL));
            return imageRegistry.get(name);
        }
    } catch (Exception e) {
        return null;
    }
}
Also used : ExtendedImageRegistry(org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry) ImageRegistry(org.eclipse.jface.resource.ImageRegistry) URL(java.net.URL) MalformedURLException(java.net.MalformedURLException)

Example 43 with ImageRegistry

use of org.eclipse.jface.resource.ImageRegistry in project webtools.sourceediting by eclipse.

the class DTDUIPlugin method getImage.

public Image getImage(String iconName) {
    ImageRegistry imageRegistry = getImageRegistry();
    Image image = imageRegistry.get(iconName);
    if (image == null) {
        String thisID = getDefault().getBundle().getSymbolicName();
        imageRegistry.put(iconName, imageDescriptorFromPlugin(thisID, iconName));
        image = imageRegistry.get(iconName);
    }
    return image;
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) Image(org.eclipse.swt.graphics.Image)

Example 44 with ImageRegistry

use of org.eclipse.jface.resource.ImageRegistry in project eclipse-integration-commons by spring-projects.

the class StsUiImages method getImage.

/**
 * Lazily initializes image map.
 */
public static Image getImage(ImageDescriptor imageDescriptor) {
    ImageRegistry imageRegistry = getImageRegistry();
    Image image = imageRegistry.get("" + imageDescriptor.hashCode());
    if (image == null) {
        image = imageDescriptor.createImage(true);
        imageRegistry.put("" + imageDescriptor.hashCode(), image);
    }
    return image;
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) Image(org.eclipse.swt.graphics.Image)

Example 45 with ImageRegistry

use of org.eclipse.jface.resource.ImageRegistry in project eclipse-integration-commons by spring-projects.

the class IdeUiPlugin method getImage.

public static Image getImage(String path) {
    ImageRegistry imageRegistry = getDefault().getImageRegistry();
    Image image = imageRegistry.get(path);
    if (image == null) {
        // Add support for loading and creating images from remote URLs
        if (path.startsWith("http")) {
            try {
                ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(new URL(path));
                if (imageDescriptor == null) {
                    imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
                }
                image = imageDescriptor.createImage(true);
                imageRegistry.put(path, image);
            } catch (Exception e) {
                // make sure to ignore all here
                ImageDescriptor imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
                image = imageDescriptor.createImage(true);
                imageRegistry.put(path, image);
            }
        } else {
            ImageDescriptor imageDescriptor = getImageDescriptor(path);
            if (imageDescriptor == null) {
                imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
            }
            image = imageDescriptor.createImage(true);
            imageRegistry.put(path, image);
        }
    }
    return image;
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) Image(org.eclipse.swt.graphics.Image) URL(java.net.URL)

Aggregations

ImageRegistry (org.eclipse.jface.resource.ImageRegistry)63 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)25 Image (org.eclipse.swt.graphics.Image)22 URL (java.net.URL)4 ResourceBundle (java.util.ResourceBundle)4 Before (org.junit.Before)4 CoreRuntimePlugin (org.talend.core.runtime.CoreRuntimePlugin)4 CompositeMultiImageDescriptor (com.archimatetool.editor.ui.components.CompositeMultiImageDescriptor)3 ResourceImageDescriptor (de.jaret.util.ui.ResourceImageDescriptor)3 CompositeImageDescriptor (org.eclipse.jface.resource.CompositeImageDescriptor)3 Label (org.eclipse.swt.widgets.Label)3 RepositoryContext (org.talend.core.context.RepositoryContext)3 Project (org.talend.core.model.general.Project)3 User (org.talend.core.model.properties.User)3 IRepositoryFactory (org.talend.core.repository.model.IRepositoryFactory)3 ProxyRepositoryFactory (org.talend.core.repository.model.ProxyRepositoryFactory)3 XmiResourceManager (org.talend.core.repository.utils.XmiResourceManager)3 IRepositoryNodeConfiguration (org.talend.mdm.repository.core.IRepositoryNodeConfiguration)3 IRepositoryNodeResourceProvider (org.talend.mdm.repository.core.IRepositoryNodeResourceProvider)3 RecycleBinNodeConfiguration (org.talend.mdm.repository.core.impl.recyclebin.RecycleBinNodeConfiguration)3