use of org.netxms.ui.eclipse.imagelibrary.dialogs.ImageSelectionDialog in project netxms by netxms.
the class ImageSelector method selectionButtonHandler.
/* (non-Javadoc)
* @see org.netxms.ui.eclipse.widgets.AbstractSelector#selectionButtonHandler()
*/
@Override
protected void selectionButtonHandler() {
ImageSelectionDialog dlg = new ImageSelectionDialog(getShell());
if (dlg.open() == Window.OK) {
LibraryImage image = dlg.getLibraryImage();
if (image != null) {
setText(image.getName());
setImage(dlg.getImage());
imageGuid = dlg.getGuid();
} else {
setText(Messages.get().ImageSelector_Default);
setImage(null);
imageGuid = NXCommon.EMPTY_GUID;
}
getParent().layout();
}
}
use of org.netxms.ui.eclipse.imagelibrary.dialogs.ImageSelectionDialog in project netxms by netxms.
the class PredefinedMap method addImageDecoration.
/**
* Add image decoration
*/
private void addImageDecoration() {
ImageSelectionDialog dlg = new ImageSelectionDialog(getSite().getShell());
if (dlg.open() != Window.OK)
return;
UUID imageGuid = dlg.getLibraryImage().getGuid();
Rectangle imageBounds = dlg.getImage().getBounds();
NetworkMapDecoration element = new NetworkMapDecoration(mapPage.createElementId(), NetworkMapDecoration.IMAGE);
element.setSize(imageBounds.width, imageBounds.height);
element.setTitle(imageGuid.toString());
mapPage.addElement(element);
saveMap();
}
Aggregations