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));
}
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();
}
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"));
}
Aggregations