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();
}
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;
}
}
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;
}
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;
}
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;
}
Aggregations