use of org.eclipse.jface.resource.ImageDescriptor in project dbeaver by serge-rider.
the class DBeaverIcons method getIconByLocation.
private static IconDescriptor getIconByLocation(String location) {
IconDescriptor icon = imageMap.get(location);
if (icon == null) {
try {
ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(new URL(location));
icon = new IconDescriptor(location, imageDescriptor);
if (icon.image == null) {
log.warn("Bad image: " + location);
return null;
} else {
imageMap.put(location, icon);
}
} catch (Exception e) {
log.error(e);
return null;
}
}
return icon;
}
use of org.eclipse.jface.resource.ImageDescriptor in project dbeaver by serge-rider.
the class ERDEditorPart method createPaletteRoot.
public PaletteRoot createPaletteRoot() {
// create root
PaletteRoot paletteRoot = new PaletteRoot();
paletteRoot.setLabel("Entity Diagram");
{
// a group of default control tools
PaletteDrawer controls = new PaletteDrawer("Tools", DBeaverIcons.getImageDescriptor(UIIcon.CONFIGURATION));
paletteRoot.add(controls);
// the selection tool
ToolEntry selectionTool = new SelectionToolEntry();
controls.add(selectionTool);
// use selection tool as default entry
paletteRoot.setDefaultEntry(selectionTool);
// the marquee selection tool
controls.add(new MarqueeToolEntry());
if (!isReadOnly()) {
// separator
PaletteSeparator separator = new PaletteSeparator("tools");
separator.setUserModificationPermission(PaletteEntry.PERMISSION_NO_MODIFICATION);
controls.add(separator);
final ImageDescriptor connectImage = ERDActivator.getImageDescriptor("icons/connect.png");
controls.add(new ConnectionCreationToolEntry("Connection", "Create Connection", null, connectImage, connectImage));
final ImageDescriptor noteImage = ERDActivator.getImageDescriptor("icons/note.png");
controls.add(new CreationToolEntry("Note", "Create Note", new CreationFactory() {
@Override
public Object getNewObject() {
return new ERDNote("Note");
}
@Override
public Object getObjectType() {
return RequestConstants.REQ_CREATE;
}
}, noteImage, noteImage));
}
}
return paletteRoot;
}
use of org.eclipse.jface.resource.ImageDescriptor in project dbeaver by serge-rider.
the class ApplicationWorkbenchAdvisor method declareWorkbenchImage.
private void declareWorkbenchImage(IWorkbenchConfigurer configurer, Bundle ideBundle, String symbolicName, String path, boolean shared) {
URL url = FileLocator.find(ideBundle, new Path(path), null);
ImageDescriptor desc = ImageDescriptor.createFromURL(url);
configurer.declareImage(symbolicName, desc, shared);
}
use of org.eclipse.jface.resource.ImageDescriptor in project meclipse by flaper87.
the class MeclipsePlugin method initializeImageRegistry.
@Override
protected void initializeImageRegistry(ImageRegistry registry) {
super.initializeImageRegistry(registry);
Bundle bundle = Platform.getBundle(PLUGIN_ID);
for (String img_id : IMG_ID_LIST) {
ImageDescriptor myImage = ImageDescriptor.createFromURL(FileLocator.find(bundle, new Path(img_id), null));
registry.put(img_id, myImage);
}
}
use of org.eclipse.jface.resource.ImageDescriptor in project translationstudio8 by heartsome.
the class DefaultTableHeaderRenderer method getImageRegistry.
private ImageRegistry getImageRegistry() {
if (_imageRegistry == null) {
_imageRegistry = new ImageRegistry();
ImageDescriptor imgDesc = new LocalResourceImageDescriptor("/de/jaret/util/ui/table/resource/smallarrow_down.gif");
_imageRegistry.put(DOWN, imgDesc.createImage());
imgDesc = new LocalResourceImageDescriptor("/de/jaret/util/ui/table/resource/smallarrow_up.gif");
_imageRegistry.put(UP, imgDesc.createImage());
}
return _imageRegistry;
}
Aggregations