Search in sources :

Example 36 with ImageDescriptor

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

the class EditTableAction method init.

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

Example 37 with ImageDescriptor

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

the class ModifyTableNameAction method init.

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

Example 38 with ImageDescriptor

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

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

Example 39 with ImageDescriptor

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

the class GraphPlanImageSupport method getImage.

public static Image getImage(PlanNode planNode) {
    String method = planNode.getMethod();
    if (method == null) {
        return CommonUIPlugin.getImage("icons/queryplan/default.png");
    }
    method = method.toLowerCase();
    method = method.replaceAll(" ", "_");
    method = method.replaceAll("\\-", "_");
    method = method.replaceAll("\\(", "");
    method = method.replaceAll("\\)", "");
    if (method.equals("temp") && StringUtil.isNotEmpty(planNode.getOrder())) {
        method = "temp_order";
    } else if (method.equals("tempgroup_by")) {
        method = "temp_group_by";
    } else if (method.equals("temporder_by")) {
        method = "temp_order";
    }
    String imagePath = "icons/queryplan/" + method + ".png";
    ImageDescriptor imageDescript = CommonUIPlugin.getImageDescriptor(imagePath);
    if (imageDescript == null) {
        return CommonUIPlugin.getImage("icons/queryplan/default.png");
    }
    return CommonUIPlugin.getImage(imagePath);
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Example 40 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project ow by vtst.

the class OwJsClosurePlugin method createImage.

private Image createImage(String key) {
    IPath path = getImageBasePath().append(key);
    URL url = FileLocator.find(getBundle(), path, null);
    if (url != null) {
        ImageDescriptor descriptor = ImageDescriptor.createFromURL(url);
        if (descriptor != null)
            return descriptor.createImage();
    }
    return null;
}
Also used : IPath(org.eclipse.core.runtime.IPath) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) URL(java.net.URL)

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