use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.
the class Activator method getImage.
/**
* Returns an image for the image file at the given plug-in relative path.
*
* @param path
* the path
* @return the image
*/
public static Image getImage(String path) {
Image image = getDefault().getImageRegistry().get(path);
if (image == null || image.isDisposed()) {
ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
Activator.getDefault().getImageRegistry().put(path, imageDesc);
return Activator.getDefault().getImageRegistry().get(path);
}
return image;
}
use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.
the class Activator method getImageDescriptor.
/**
* Returns an image descriptor for the image file at the given plug-in
* relative path.
*
* @param path
* the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
ImageDescriptor imageDesc = getDefault().getImageRegistry().getDescriptor(path);
if (imageDesc == null) {
imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
Activator.getDefault().getImageRegistry().put(path, imageDesc);
}
return imageDesc;
}
use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.
the class Activator method getImage.
/**
* Returns an image for the image file at the given plug-in relative path.
*
* @param path
* the path
* @return the image
*/
public static Image getImage(String path) {
Image image = getDefault().getImageRegistry().get(path);
if (image == null || image.isDisposed()) {
ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
Activator.getDefault().getImageRegistry().put(path, imageDesc);
return Activator.getDefault().getImageRegistry().get(path);
}
return image;
}
use of org.eclipse.jface.resource.ImageDescriptor in project bndtools by bndtools.
the class ProjectBuildPage method loadProblems.
void loadProblems() {
IResource resource = ResourceUtil.getResource(getEditorInput());
problemSeverity = 0;
messageSeverityMap.clear();
if (resource != null) {
try {
IMarker[] markers;
markers = resource.findMarkers(BndtoolsConstants.MARKER_BND_PROBLEM, true, 0);
loadMarkers(markers);
markers = resource.findMarkers(BndtoolsConstants.MARKER_BND_PATH_PROBLEM, true, 0);
loadMarkers(markers);
markers = resource.findMarkers(BndtoolsConstants.MARKER_BND_MISSING_WORKSPACE, true, 0);
loadMarkers(markers);
} catch (CoreException e) {
logger.logError("Error retrieving problem markers", e);
}
}
ImageDescriptor editorImgOverlay;
if (problemSeverity >= IMarker.SEVERITY_ERROR) {
pageImage = imgError;
editorImgOverlay = imgErrorOverlay;
} else if (problemSeverity >= IMarker.SEVERITY_WARNING) {
pageImage = imgWarning;
editorImgOverlay = imgWarningOverlay;
} else {
pageImage = null;
editorImgOverlay = null;
}
editor.updatePageTitle(this);
editor.setOverlayTitleImage(editorImgOverlay);
}
use of org.eclipse.jface.resource.ImageDescriptor in project bndtools by bndtools.
the class PackageInfoEditor method setInitializationData.
@Override
public void setInitializationData(IConfigurationElement cfig, String propertyName, Object data) {
super.setInitializationData(cfig, propertyName, data);
String strIcon = cfig.getAttribute("icon");
// Load the icons
ImageDescriptor baseImageDesc = strIcon != null ? AbstractUIPlugin.imageDescriptorFromPlugin(cfig.getContributor().getName(), strIcon) : null;
imgTitleBase = baseImageDesc != null ? baseImageDesc.createImage() : getDefaultImage();
ImageDescriptor imgWarningOverlay = AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/warning_co.gif");
DecorationOverlayIcon warningImageDesc = new DecorationOverlayIcon(imgTitleBase, imgWarningOverlay, IDecoration.BOTTOM_LEFT);
imgTitleWarning = warningImageDesc.createImage();
ImageDescriptor imgErrorOverlay = AbstractUIPlugin.imageDescriptorFromPlugin(Plugin.PLUGIN_ID, "icons/error_co.gif");
DecorationOverlayIcon errorImageDesc = new DecorationOverlayIcon(imgTitleBase, imgErrorOverlay, IDecoration.BOTTOM_LEFT);
imgTitleError = errorImageDesc.createImage();
titleImage = imgTitleBase;
}
Aggregations