use of org.netxms.client.maps.elements.NetworkMapDCIContainer 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.NetworkMapDCIContainer in project netxms by netxms.
the class PredefinedMap method addDCIContainerToMap.
/**
* Add DCI container to map
*/
private void addDCIContainerToMap() {
NetworkMapDCIContainer dciContainer = new NetworkMapDCIContainer(mapPage.createElementId());
// runn property page
PropertyDialog dlg = PropertyDialog.createDialogOn(getSite().getShell(), null, dciContainer);
if (dlg != null) {
if (dlg.open() == Window.OK) {
mapPage.addElement(dciContainer);
saveMap();
addDciToRequestList();
}
}
}
use of org.netxms.client.maps.elements.NetworkMapDCIContainer in project netxms by netxms.
the class AbstractNetworkMapView method addDciToRequestList.
/**
* Goes thought all links and trys to add to request list required DCIs.
*/
protected void addDciToRequestList() {
Collection<NetworkMapLink> linkList = mapPage.getLinks();
for (NetworkMapLink item : linkList) {
if (item.hasDciData()) {
for (SingleDciConfig value : item.getDciAsList()) {
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
Collection<NetworkMapElement> mapElements = mapPage.getElements();
for (NetworkMapElement element : mapElements) {
if (element instanceof NetworkMapDCIContainer) {
NetworkMapDCIContainer item = (NetworkMapDCIContainer) element;
if (item.hasDciData()) {
for (SingleDciConfig value : item.getObjectDCIArray()) {
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
if (element instanceof NetworkMapDCIImage) {
NetworkMapDCIImage item = (NetworkMapDCIImage) element;
DCIImageConfiguration config = item.getImageOptions();
SingleDciConfig value = config.getDci();
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
use of org.netxms.client.maps.elements.NetworkMapDCIContainer in project netxms by netxms.
the class PredefinedMap method showDCIContainerProperties.
/**
* Show DCI Container properties
*/
private void showDCIContainerProperties() {
updateObjectPositions();
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if ((selection.size() != 1) || !(selection.getFirstElement() instanceof NetworkMapDCIContainer))
return;
NetworkMapDCIContainer container = (NetworkMapDCIContainer) selection.getFirstElement();
PropertyDialog dlg = PropertyDialog.createDialogOn(getSite().getShell(), null, container);
if (dlg != null) {
if (dlg.open() == PropertyDialog.OK)
saveMap();
}
}
use of org.netxms.client.maps.elements.NetworkMapDCIContainer in project netxms by netxms.
the class NetworkMapWidget method addDciToRequestList.
/**
* Goes thought all links and trys to add to request list required DCIs.
*/
protected void addDciToRequestList() {
Collection<NetworkMapLink> linkList = mapPage.getLinks();
for (NetworkMapLink item : linkList) {
if (item.hasDciData()) {
for (SingleDciConfig value : item.getDciAsList()) {
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
Collection<NetworkMapElement> mapElements = mapPage.getElements();
for (NetworkMapElement element : mapElements) {
if (element instanceof NetworkMapDCIContainer) {
NetworkMapDCIContainer item = (NetworkMapDCIContainer) element;
if (item.hasDciData()) {
for (SingleDciConfig value : item.getObjectDCIArray()) {
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
if (element instanceof NetworkMapDCIImage) {
NetworkMapDCIImage item = (NetworkMapDCIImage) element;
DCIImageConfiguration config = item.getImageOptions();
SingleDciConfig value = config.getDci();
if (value.type == SingleDciConfig.ITEM) {
dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
} else {
dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
}
}
}
}
Aggregations