Search in sources :

Example 1 with ResourceImageDescriptor

use of de.jaret.util.ui.ResourceImageDescriptor 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 2 with ResourceImageDescriptor

use of de.jaret.util.ui.ResourceImageDescriptor 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 3 with ResourceImageDescriptor

use of de.jaret.util.ui.ResourceImageDescriptor 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 4 with ResourceImageDescriptor

use of de.jaret.util.ui.ResourceImageDescriptor in project translationstudio8 by heartsome.

the class ImageCellRender method addRessourceNameMapping.

/**
	 * 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 addRessourceNameMapping(Object o, String key, String ressourceName) {
    ImageDescriptor imgDesc = new ResourceImageDescriptor(ressourceName, this.getClass());
    addImageDescriptorMapping(o, key, imgDesc);
}
Also used : ResourceImageDescriptor(de.jaret.util.ui.ResourceImageDescriptor) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ResourceImageDescriptor(de.jaret.util.ui.ResourceImageDescriptor)

Example 5 with ResourceImageDescriptor

use of de.jaret.util.ui.ResourceImageDescriptor in project translationstudio8 by heartsome.

the class ClassImageRenderer method addClassRessourceNameMapping.

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

Aggregations

ResourceImageDescriptor (de.jaret.util.ui.ResourceImageDescriptor)6 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)6 ImageRegistry (org.eclipse.jface.resource.ImageRegistry)3