use of org.netxms.client.maps.elements.NetworkMapTextBox in project netxms by netxms.
the class PredefinedMap method fillElementContextMenu.
/*
* (non-Javadoc)
*
* @see
* org.netxms.ui.eclipse.networkmaps.views.NetworkMap#fillElementContextMenu
* (org.eclipse.jface.action.IMenuManager)
*/
protected void fillElementContextMenu(IMenuManager manager) {
if (!readOnly) {
manager.add(actionRemove);
Object o = ((IStructuredSelection) viewer.getSelection()).getFirstElement();
if (o instanceof NetworkMapDCIContainer)
manager.add(actionDCIContainerProperties);
if (o instanceof NetworkMapDCIImage)
manager.add(actionDCIImageProperties);
if (o instanceof NetworkMapTextBox)
manager.add(actionTextBoxProperties);
if (o instanceof NetworkMapDecoration)
manager.add(actionGroupBoxEdit);
manager.add(new Separator());
}
super.fillElementContextMenu(manager);
}
use of org.netxms.client.maps.elements.NetworkMapTextBox in project netxms by netxms.
the class PredefinedMap method addTextBoxToMap.
/**
* Add text box element
*/
private void addTextBoxToMap() {
NetworkMapTextBox textBox = new NetworkMapTextBox(mapPage.createElementId());
PropertyDialog dlg = PropertyDialog.createDialogOn(getSite().getShell(), null, textBox);
if (dlg.open() != Window.OK)
return;
mapPage.addElement(textBox);
saveMap();
}
use of org.netxms.client.maps.elements.NetworkMapTextBox in project netxms by netxms.
the class PredefinedMap method showTextBoxProperties.
/**
* Show text box properties
*/
private void showTextBoxProperties() {
updateObjectPositions();
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if ((selection.size() != 1) || !(selection.getFirstElement() instanceof NetworkMapTextBox))
return;
PropertyDialog dlg = PropertyDialog.createDialogOn(getSite().getShell(), null, (NetworkMapTextBox) selection.getFirstElement());
if (dlg.open() != Window.OK)
return;
saveMap();
}
use of org.netxms.client.maps.elements.NetworkMapTextBox in project netxms by netxms.
the class AbstractNetworkMapView method openDrillDownObject.
/**
* Open drill-down object for currently selected object
*/
private void openDrillDownObject() {
if (currentSelection == null)
return;
long objectId = 0;
Object object = currentSelection.getFirstElement();
if (object instanceof AbstractObject)
objectId = (object instanceof NetworkMap) ? ((AbstractObject) object).getObjectId() : ((AbstractObject) object).getDrillDownObjectId();
else if (object instanceof NetworkMapTextBox)
objectId = ((NetworkMapTextBox) object).getDrillDownObjectId();
if (objectId != 0) {
Object test = session.findObjectById(objectId);
if (test instanceof NetworkMap) {
try {
getSite().getPage().showView(PredefinedMap.ID, Long.toString(objectId), IWorkbenchPage.VIEW_ACTIVATE);
} catch (PartInitException e) {
MessageDialogHelper.openError(getSite().getShell(), Messages.get().AbstractNetworkMapView_Error, String.format("Cannot open drill-down object view: %s", e.getMessage()));
}
}
if (test instanceof Dashboard) {
try {
getSite().getPage().showView("org.netxms.ui.eclipse.dashboard.views.DashboardView", Long.toString(objectId), IWorkbenchPage.VIEW_ACTIVATE);
} catch (PartInitException e) {
MessageDialogHelper.openError(getSite().getShell(), Messages.get().AbstractNetworkMapView_Error, String.format("Cannot open drill-down object view: %s", e.getMessage()));
}
}
}
}
Aggregations