use of org.eclipse.jface.resource.ImageDescriptor in project dbeaver by serge-rider.
the class DBeaverIcons method getCompositeIcon.
private static IconDescriptor getCompositeIcon(IconDescriptor mainIcon, DBIconComposite image) {
if (!image.hasOverlays()) {
return mainIcon;
}
String compositeId = mainIcon.id + "^" + (image.getTopLeft() == null ? "" : image.getTopLeft().getLocation()) + "^" + (image.getTopRight() == null ? "" : image.getTopRight().getLocation()) + "^" + (image.getBottomLeft() == null ? "" : image.getBottomLeft().getLocation()) + "^" + (image.getBottomRight() == null ? "" : image.getBottomRight().getLocation());
IconDescriptor icon = compositeMap.get(compositeId);
if (icon == null) {
OverlayImageDescriptor ovrImage = new OverlayImageDescriptor(mainIcon.image.getImageData());
if (image.getTopLeft() != null)
ovrImage.setTopLeft(new ImageDescriptor[] { getImageDescriptor(image.getTopLeft()) });
if (image.getTopRight() != null)
ovrImage.setTopRight(new ImageDescriptor[] { getImageDescriptor(image.getTopRight()) });
if (image.getBottomLeft() != null)
ovrImage.setBottomLeft(new ImageDescriptor[] { getImageDescriptor(image.getBottomLeft()) });
if (image.getBottomRight() != null)
ovrImage.setBottomRight(new ImageDescriptor[] { getImageDescriptor(image.getBottomRight()) });
Image resultImage = ovrImage.createImage();
icon = new IconDescriptor(compositeId, resultImage);
compositeMap.put(compositeId, icon);
}
return icon;
}
use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.
the class DeleteAction method init.
protected void init() {
setText(NAME);
setToolTipText(NAME);
setId(ID);
ImageDescriptor icon = CommonUIPlugin.getImageDescriptor("icons/action/table_record_delete.png");
if (icon != null) {
setImageDescriptor(icon);
setEnabled(true);
}
}
use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.
the class CubridManagerAppPlugin 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 static ImageDescriptor getImageDescriptor(String path) {
ImageDescriptor imageDesc = getDefault().getImageRegistry().getDescriptor(path);
if (imageDesc == null) {
imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
CubridManagerAppPlugin.getDefault().getImageRegistry().put(path, imageDesc);
}
return imageDesc;
}
use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.
the class CommonUIPlugin method getImage.
public static Image getImage(String path) {
Image image = getDefault().getImageRegistry().get(path);
if (image == null || image.isDisposed()) {
ImageDescriptor imageDesc = AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
if (CommonUIPlugin.getDefault().getImageRegistry().get(path) != null) {
CommonUIPlugin.getDefault().getImageRegistry().remove(path);
}
CommonUIPlugin.getDefault().getImageRegistry().put(path, imageDesc);
return CommonUIPlugin.getDefault().getImageRegistry().get(path);
}
return image;
}
use of org.eclipse.jface.resource.ImageDescriptor in project cubrid-manager by CUBRID.
the class ImportERwinDataAction method init.
@Override
public void init() {
setId(ID);
setText(NAME);
setToolTipText(NAME);
ImageDescriptor icon = CommonUIPlugin.getImageDescriptor("icons/action/import_on.png");
if (icon != null) {
setImageDescriptor(icon);
setEnabled(false);
}
}
Aggregations