Search in sources :

Example 41 with ImageDescriptor

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;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) Image(org.eclipse.swt.graphics.Image)

Example 42 with ImageDescriptor

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;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Example 43 with ImageDescriptor

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;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) Image(org.eclipse.swt.graphics.Image)

Example 44 with ImageDescriptor

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);
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) IMarker(org.eclipse.core.resources.IMarker) IResource(org.eclipse.core.resources.IResource)

Example 45 with ImageDescriptor

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;
}
Also used : DecorationOverlayIcon(org.eclipse.jface.viewers.DecorationOverlayIcon) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Aggregations

ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)106 Image (org.eclipse.swt.graphics.Image)25 ArrayList (java.util.ArrayList)21 List (java.util.List)18 ToolEntry (org.eclipse.gef.palette.ToolEntry)14 URL (java.net.URL)12 ImageData (org.eclipse.swt.graphics.ImageData)11 ResourceImageDescriptor (de.jaret.util.ui.ResourceImageDescriptor)9 Point (org.eclipse.swt.graphics.Point)6 Node (org.talend.designer.core.ui.editor.nodes.Node)6 Path (org.eclipse.core.runtime.Path)5 JavaElementImageDescriptor (org.eclipse.jdt.ui.JavaElementImageDescriptor)5 File (java.io.File)4 HashMap (java.util.HashMap)4 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)4 IComponent (org.talend.core.model.components.IComponent)4 INode (org.talend.core.model.process.INode)4 MalformedURLException (java.net.MalformedURLException)3 Set (java.util.Set)3 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)3