Search in sources :

Example 6 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project translationstudio8 by heartsome.

the class ObjectImageRenderer method addObjectRessourceNameMapping.

/**
     * Add a mapping between object instance and an image ressource.
     * 
     * @param o object instance
     * @param key string key (has to be non null an unique for this renderer) to identfy the object
     * @param ressourceName ressource path
     */
public void addObjectRessourceNameMapping(Object o, String key, String ressourceName) {
    ImageDescriptor imgDesc = new ResourceImageDescriptor(ressourceName, this.getClass());
    addObjectImageDescriptorMapping(o, key, imgDesc);
}
Also used : ResourceImageDescriptor(de.jaret.util.ui.ResourceImageDescriptor) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ResourceImageDescriptor(de.jaret.util.ui.ResourceImageDescriptor)

Example 7 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project translationstudio8 by heartsome.

the class BooleanCellRenderer method getImageRegistry.

/**
     * Retrieve the image registry used by the renderer (lazy initializing).
     * 
     * @return initialized image regsitry containing the resources
     */
private ImageRegistry getImageRegistry() {
    if (_imageRegistry == null) {
        _imageRegistry = new ImageRegistry();
        ImageDescriptor imgDesc = new ResourceImageDescriptor(_checkedRscName, this.getClass());
        _imageRegistry.put(CHECKED, imgDesc.createImage());
        imgDesc = new ResourceImageDescriptor(_uncheckedRscName, this.getClass());
        _imageRegistry.put(UNCHECKED, imgDesc.createImage());
    }
    return _imageRegistry;
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) ResourceImageDescriptor(de.jaret.util.ui.ResourceImageDescriptor) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ResourceImageDescriptor(de.jaret.util.ui.ResourceImageDescriptor)

Example 8 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project translationstudio8 by heartsome.

the class MultiLineListExample method getImageRegistry.

public static ImageRegistry getImageRegistry() {
    if (_imageRegistry == null) {
        _imageRegistry = new ImageRegistry();
        ImageDescriptor imgDesc = new ResourceImageDescriptor("/de/jaret/examples/table/mllist/icon.gif");
        _imageRegistry.put("icon", imgDesc);
        imgDesc = new ResourceImageDescriptor("/de/jaret/examples/table/keyboard.png");
        _imageRegistry.put("keyboard", imgDesc);
    }
    return _imageRegistry;
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) ResourceImageDescriptor(de.jaret.util.ui.ResourceImageDescriptor) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ResourceImageDescriptor(de.jaret.util.ui.ResourceImageDescriptor)

Example 9 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project translationstudio8 by heartsome.

the class Activator method getIconDescriptor.

/**
	 * 提供一个图片文件对插件的相对路径,返回该图片被伸缩变换为16*16像素的描述信息。
	 * @param path
	 *            the path
	 * @return the icon descriptor
	 */
public static ImageDescriptor getIconDescriptor(String path) {
    ImageDescriptor image = getImageDescriptor(path);
    ImageData data = image.getImageData();
    data = data.scaledTo(16, 16);
    image = ImageDescriptor.createFromImageData(data);
    return image;
}
Also used : ImageData(org.eclipse.swt.graphics.ImageData) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Example 10 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project translationstudio8 by heartsome.

the class Activator method getIconDescriptor.

/**
	 * 提供一个图片文件对插件的相对路径,返回该图片被伸缩变换为16*16像素的描述信息。
	 * @param path
	 *            the path
	 * @return the icon descriptor
	 */
public static ImageDescriptor getIconDescriptor(String path) {
    ImageDescriptor image = getImageDescriptor(path);
    ImageData data = image.getImageData();
    data = data.scaledTo(16, 16);
    image = ImageDescriptor.createFromImageData(data);
    return image;
}
Also used : ImageData(org.eclipse.swt.graphics.ImageData) 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