Search in sources :

Example 21 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project tdi-studio-se by Talend.

the class BusinessPaletteFactory method createBidirectionalRelationship15CreationTool.

/**
     * @generated NOT
     */
private ToolEntry createBidirectionalRelationship15CreationTool() {
    ImageDescriptor smallImage;
    ImageDescriptor largeImage;
    smallImage = BusinessElementTypes.getImageDescriptor(BusinessElementTypes.BidirectionalBusinessItemRelationship_3003);
    largeImage = smallImage;
    final List relationshipTypes = new ArrayList();
    relationshipTypes.add(BusinessElementTypes.BidirectionalBusinessItemRelationship_3003);
    ToolEntry result = new LinkToolEntry(//$NON-NLS-1$ //$NON-NLS-2$
    Messages.getString("BusinessPaletteFactory.BidirectionalRelationShip"), //$NON-NLS-1$ //$NON-NLS-2$
    Messages.getString("BusinessPaletteFactory.CreateBidirectionalRelationShip"), smallImage, largeImage, relationshipTypes);
    return result;
}
Also used : ArrayList(java.util.ArrayList) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ArrayList(java.util.ArrayList) List(java.util.List) ToolEntry(org.eclipse.gef.palette.ToolEntry)

Example 22 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project tdi-studio-se by Talend.

the class BusinessElementTypes method getImage.

/**
     * @generated
     */
public static Image getImage(ENamedElement element) {
    String key = getImageRegistryKey(element);
    Image image = getImageRegistry().get(key);
    if (image == null) {
        ImageDescriptor imageDescriptor = getProvidedImageDescriptor(element);
        if (imageDescriptor == null) {
            imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
        }
        getImageRegistry().put(key, imageDescriptor);
        image = getImageRegistry().get(key);
    }
    return image;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) Image(org.eclipse.swt.graphics.Image)

Example 23 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project tdi-studio-se by Talend.

the class BusinessElementTypes method getImageDescriptor.

/**
     * @generated
     */
public static ImageDescriptor getImageDescriptor(ENamedElement element) {
    String key = getImageRegistryKey(element);
    ImageDescriptor imageDescriptor = getImageRegistry().getDescriptor(key);
    if (imageDescriptor == null) {
        imageDescriptor = getProvidedImageDescriptor(element);
        if (imageDescriptor == null) {
            imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
        }
        getImageRegistry().put(key, imageDescriptor);
    }
    return imageDescriptor;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Example 24 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project tdi-studio-se by Talend.

the class BusinessPaletteFactory method createDecision1CreationTool.

/**
     * @generated NOT
     */
private ToolEntry createDecision1CreationTool() {
    ImageDescriptor smallImage;
    ImageDescriptor largeImage;
    smallImage = BusinessElementTypes.getImageDescriptor(BusinessElementTypes.DecisionBusinessItem_1008);
    largeImage = smallImage;
    final List elementTypes = new ArrayList();
    elementTypes.add(BusinessElementTypes.DecisionBusinessItem_1008);
    ToolEntry result = new NodeToolEntry(Messages.getString("BusinessPaletteFactory.decision"), Messages.getString("BusinessPaletteFactory.DecisionComment"), smallImage, largeImage, //$NON-NLS-1$ //$NON-NLS-2$
    elementTypes);
    return result;
}
Also used : ArrayList(java.util.ArrayList) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) ArrayList(java.util.ArrayList) List(java.util.List) ToolEntry(org.eclipse.gef.palette.ToolEntry)

Example 25 with ImageDescriptor

use of org.eclipse.jface.resource.ImageDescriptor in project tdi-studio-se by Talend.

the class ComponentIconLoading method getImage16.

public ImageDescriptor getImage16() {
    ImageDescriptor image16 = null;
    ImageDescriptor image32 = registry.get(folder.getName() + "_32");
    if (image16 == null) {
        File file16 = new File(folder, ComponentFilesNaming.getInstance().getIcon16FileName(folder.getName()));
        if (file16.exists()) {
            image16 = getImage(ComponentFilesNaming.getInstance().getIcon16FileName(folder.getName()));
        } else if (image32 != null && image32.getImageData() != null) {
            image16 = ImageDescriptor.createFromImageData(image32.getImageData().scaledTo(16, 16));
        }
    }
    registry.put(folder.getName() + "_16", image16);
    return image16;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) File(java.io.File)

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