Search in sources :

Example 61 with ImageRegistry

use of org.eclipse.jface.resource.ImageRegistry in project InformationSystem by ObeoNetwork.

the class RequirementLinkerPlugin method getImageDescriptor.

/**
 * Returns an image descriptor for the image file at the given plug-in
 * relative path
 *
 * @param path
 *            the path
 * @return the image descriptor
 */
public ImageDescriptor getImageDescriptor(String imageID) {
    ImageRegistry registry = getImageRegistry();
    if (registry.get(imageID) == null) {
        Bundle bundle = Platform.getBundle(PLUGIN_ID);
        IPath path = new Path(ICONS_FOLDER + imageID + ICONS_EXTENSION);
        URL url = FileLocator.find(bundle, path, null);
        ImageDescriptor desc = ImageDescriptor.createFromURL(url);
        registry.put(imageID, desc);
    }
    return ImageDescriptor.createFromImage(registry.get(imageID));
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) ImageRegistry(org.eclipse.jface.resource.ImageRegistry) IPath(org.eclipse.core.runtime.IPath) Bundle(org.osgi.framework.Bundle) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor) URL(java.net.URL)

Example 62 with ImageRegistry

use of org.eclipse.jface.resource.ImageRegistry in project bndtools by bndtools.

the class BundleTreeImages method getImageRegistry.

public static synchronized ImageRegistry getImageRegistry() {
    if (Activator.getDefault() == null) {
        if (imageRegistry == null) {
            imageRegistry = new ImageRegistry();
            initImageRegistry(imageRegistry);
        }
        return imageRegistry;
    }
    return Activator.getDefault().getImageRegistry();
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry)

Example 63 with ImageRegistry

use of org.eclipse.jface.resource.ImageRegistry in project meclipse by flaper87.

the class CollectionEditor method createPages.

@Override
protected void createPages() {
    final Composite composite = new Composite(getContainer(), SWT.FILL);
    ImageRegistry reg = MeclipsePlugin.getDefault().getImageRegistry();
    composite.setLayout(new MigLayout("wrap 9", "[][][][40px!][][40px!][][][]", "[30px!][]"));
    Label find = new Label(composite, SWT.FILL);
    find.setLayoutData("w 30!");
    find.setText(getCaption("collectionEditor.find"));
    query = new Text(composite, SWT.FILL);
    query.setLayoutData("w 100: 500: 600");
    query.setText("{}");
    Label skip = new Label(composite, SWT.FILL);
    skip.setText(getCaption("collectionEditor.skip"));
    skipV = new Text(composite, SWT.FILL);
    skipV.setText("0");
    skipV.setLayoutData("w 40px!");
    skipV.addListener(SWT.DefaultSelection, runQuery);
    Label limit = new Label(composite, SWT.FILL);
    limit.setText(getCaption("collectionEditor.limit"));
    limitV = new Text(composite, SWT.FILL);
    limitV.setText("10");
    limitV.setLayoutData("w 40px!");
    limitV.addListener(SWT.DefaultSelection, runQuery);
    search = new Button(composite, SWT.PUSH);
    search.setToolTipText(getCaption("collectionEditor.tooltip.search"));
    search.setImage(reg.get(MeclipsePlugin.FIND_IMG_ID));
    search.addListener(SWT.Selection, runQuery);
    more = new Button(composite, SWT.PUSH);
    more.setToolTipText(getCaption("collectionEditor.tooltip.next"));
    more.setImage(reg.get(MeclipsePlugin.GET_NEXT_IMG_ID));
    more.setEnabled(false);
    more.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event arg0) {
            loadEntries(false);
        }
    });
    all = new Button(composite, SWT.PUSH);
    all.setToolTipText(String.format(getCaption("collectionEditor.tooltip.getAll"), maxElements));
    all.setImage(reg.get(MeclipsePlugin.GET_ALL_IMG_ID));
    all.setEnabled(false);
    all.addListener(SWT.Selection, new Listener() {

        @Override
        public void handleEvent(Event arg0) {
            loadEntries(true);
        }
    });
    bar = new ExpandBar(composite, SWT.V_SCROLL);
    bar.setLayoutData("span, w 100%-20px !,h 100%-50px !");
    cursor = col.getCollection().find().limit(maxElements);
    loadEntries(false);
    int index = addPage(composite);
    setPageText(index, getCaption("collectionEditor.tab.properties"));
}
Also used : ImageRegistry(org.eclipse.jface.resource.ImageRegistry) ExpandBar(org.eclipse.swt.widgets.ExpandBar) Listener(org.eclipse.swt.widgets.Listener) IResourceChangeListener(org.eclipse.core.resources.IResourceChangeListener) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) MigLayout(net.miginfocom.swt.MigLayout) Label(org.eclipse.swt.widgets.Label) Event(org.eclipse.swt.widgets.Event) IResourceChangeEvent(org.eclipse.core.resources.IResourceChangeEvent) Text(org.eclipse.swt.widgets.Text)

Aggregations

ImageRegistry (org.eclipse.jface.resource.ImageRegistry)63 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)25 Image (org.eclipse.swt.graphics.Image)22 URL (java.net.URL)4 ResourceBundle (java.util.ResourceBundle)4 Before (org.junit.Before)4 CoreRuntimePlugin (org.talend.core.runtime.CoreRuntimePlugin)4 CompositeMultiImageDescriptor (com.archimatetool.editor.ui.components.CompositeMultiImageDescriptor)3 ResourceImageDescriptor (de.jaret.util.ui.ResourceImageDescriptor)3 CompositeImageDescriptor (org.eclipse.jface.resource.CompositeImageDescriptor)3 Label (org.eclipse.swt.widgets.Label)3 RepositoryContext (org.talend.core.context.RepositoryContext)3 Project (org.talend.core.model.general.Project)3 User (org.talend.core.model.properties.User)3 IRepositoryFactory (org.talend.core.repository.model.IRepositoryFactory)3 ProxyRepositoryFactory (org.talend.core.repository.model.ProxyRepositoryFactory)3 XmiResourceManager (org.talend.core.repository.utils.XmiResourceManager)3 IRepositoryNodeConfiguration (org.talend.mdm.repository.core.IRepositoryNodeConfiguration)3 IRepositoryNodeResourceProvider (org.talend.mdm.repository.core.IRepositoryNodeResourceProvider)3 RecycleBinNodeConfiguration (org.talend.mdm.repository.core.impl.recyclebin.RecycleBinNodeConfiguration)3