Search in sources :

Example 71 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project dbeaver by serge-rider.

the class DBeaverIcons method getCompositeIcon.

private static IconDescriptor getCompositeIcon(IconDescriptor mainIcon, DBIconComposite image) {
    if (!image.hasOverlays()) {
        return mainIcon;
    }
    String compositeId = mainIcon.id + "^" + (image.getTopLeft() == null ? "" : image.getTopLeft().getLocation()) + "^" + (image.getTopRight() == null ? "" : image.getTopRight().getLocation()) + "^" + (image.getBottomLeft() == null ? "" : image.getBottomLeft().getLocation()) + "^" + (image.getBottomRight() == null ? "" : image.getBottomRight().getLocation());
    IconDescriptor icon = compositeMap.get(compositeId);
    if (icon == null) {
        OverlayImageDescriptor ovrImage = new OverlayImageDescriptor(mainIcon.image.getImageData());
        if (image.getTopLeft() != null)
            ovrImage.setTopLeft(new ImageDescriptor[] { getImageDescriptor(image.getTopLeft()) });
        if (image.getTopRight() != null)
            ovrImage.setTopRight(new ImageDescriptor[] { getImageDescriptor(image.getTopRight()) });
        if (image.getBottomLeft() != null)
            ovrImage.setBottomLeft(new ImageDescriptor[] { getImageDescriptor(image.getBottomLeft()) });
        if (image.getBottomRight() != null)
            ovrImage.setBottomRight(new ImageDescriptor[] { getImageDescriptor(image.getBottomRight()) });
        Image resultImage = ovrImage.createImage();
        icon = new IconDescriptor(compositeId, resultImage);
        compositeMap.put(compositeId, icon);
    }
    return icon;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) Image(org.eclipse.swt.graphics.Image) DBPImage(org.jkiss.dbeaver.model.DBPImage)

Example 72 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.

the class DeleteAction method init.

protected void init() {
    setText(NAME);
    setToolTipText(NAME);
    setId(ID);
    ImageDescriptor icon = CommonUIPlugin.getImageDescriptor("icons/action/table_record_delete.png");
    if (icon != null) {
        setImageDescriptor(icon);
        setEnabled(true);
    }
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Example 73 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.

the class CubridManagerAppPlugin 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);
        CubridManagerAppPlugin.getDefault().getImageRegistry().put(path, imageDesc);
    }
    return imageDesc;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Example 74 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.

the class CommonUIPlugin method getImage.

public static Image getImage(String path) {
    Image image = getDefault().getImageRegistry().get(path);
    if (image == null || image.isDisposed()) {
        ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
        if (CommonUIPlugin.getDefault().getImageRegistry().get(path) != null) {
            CommonUIPlugin.getDefault().getImageRegistry().remove(path);
        }
        CommonUIPlugin.getDefault().getImageRegistry().put(path, imageDesc);
        return CommonUIPlugin.getDefault().getImageRegistry().get(path);
    }
    return image;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) Image(org.eclipse.swt.graphics.Image)

Example 75 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.

the class ImportERwinDataAction method init.

@Override
public void init() {
    setId(ID);
    setText(NAME);
    setToolTipText(NAME);
    ImageDescriptor icon = CommonUIPlugin.getImageDescriptor("icons/action/import_on.png");
    if (icon != null) {
        setImageDescriptor(icon);
        setEnabled(false);
    }
}
Also used : 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