Search in sources :

Example 86 with ImageDescriptor

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

the class ComponentIconLoading method getImage24.

public ImageDescriptor getImage24() {
    ImageDescriptor image24 = null;
    ImageDescriptor image32 = registry.get(folder.getName() + "_32");
    File file24 = new File(folder, ComponentFilesNaming.getInstance().getIcon24FileName(folder.getName()));
    if (file24.exists()) {
        image24 = getImage(ComponentFilesNaming.getInstance().getIcon24FileName(folder.getName()));
    } else if (image32 != null && image32.getImageData() != null) {
        try {
            image24 = ImageDescriptor.createFromImageData(image32.getImageData().scaledTo(24, 24));
        } catch (NullPointerException e) {
            image24 = image32;
        }
    }
    registry.put(folder.getName() + "_24", image24);
    return image24;
}
Also used : ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) File(java.io.File)

Example 87 with ImageDescriptor

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

the class AttributeLabelProvider method getWriteOverlayImage.

/**
     * Gets the write overlay image.
     * 
     * @return The write overlay image
     */
private Image getWriteOverlayImage() {
    if (writeOverlayImage == null || writeOverlayImage.isDisposed()) {
        ImageDescriptor[] descriptors = new ImageDescriptor[] { null, null, null, null };
        descriptors[IDecoration.TOP_RIGHT] = Activator.getImageDescriptor(ISharedImages.WRITE_OVR_IMG_PATH);
        ImageData imageData = Activator.getImageDescriptor(ISharedImages.ATTRIBUTE_IMG_PATH).getImageData();
        writeOverlayImage = new OverlayImageDescriptor(imageData, descriptors, new Point(IMAGE_WIDTH, 16)).createImage();
    }
    return writeOverlayImage;
}
Also used : ImageData(org.eclipse.swt.graphics.ImageData) CompositeImageDescriptor(org.eclipse.jface.resource.CompositeImageDescriptor) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) Point(org.eclipse.swt.graphics.Point)

Example 88 with ImageDescriptor

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

the class BusinessPaletteFactory method createGear11CreationTool.

/**
     * @generated NOT
     */
private ToolEntry createGear11CreationTool() {
    ImageDescriptor smallImage;
    ImageDescriptor largeImage;
    smallImage = BusinessElementTypes.getImageDescriptor(BusinessElementTypes.GearBusinessItem_1011);
    largeImage = smallImage;
    final List elementTypes = new ArrayList();
    elementTypes.add(BusinessElementTypes.GearBusinessItem_1011);
    ToolEntry result = new NodeToolEntry(Messages.getString("BusinessPaletteFactory.Gear"), Messages.getString("BusinessPaletteFactory.CreateGear"), 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 89 with ImageDescriptor

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

the class BusinessPaletteFactory method createRelationship13CreationTool.

/**
     * @generated NOT
     */
private ToolEntry createRelationship13CreationTool() {
    ImageDescriptor smallImage;
    ImageDescriptor largeImage;
    smallImage = BusinessElementTypes.getImageDescriptor(BusinessElementTypes.BusinessItemRelationship_3001);
    largeImage = smallImage;
    final List relationshipTypes = new ArrayList();
    relationshipTypes.add(BusinessElementTypes.BusinessItemRelationship_3001);
    ToolEntry result = new LinkToolEntry(Messages.getString("BusinessPaletteFactory.Relationshop"), Messages.getString("BusinessPaletteFactory.RelationshopComment"), smallImage, largeImage, //$NON-NLS-1$ //$NON-NLS-2$
    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 90 with ImageDescriptor

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

the class BusinessPaletteFactory method createDocument5CreationTool.

/**
     * @generated NOT
     */
private ToolEntry createDocument5CreationTool() {
    ImageDescriptor smallImage;
    ImageDescriptor largeImage;
    smallImage = BusinessElementTypes.getImageDescriptor(BusinessElementTypes.DocumentBusinessItem_1003);
    largeImage = smallImage;
    final List elementTypes = new ArrayList();
    elementTypes.add(BusinessElementTypes.DocumentBusinessItem_1003);
    ToolEntry result = new NodeToolEntry(Messages.getString("BusinessPaletteFactory.Document"), Messages.getString("BusinessPaletteFactory.DocuemntComment"), 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)

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