use of org.netxms.client.objects.NetworkMap in project netxms by netxms.
the class NetworkMapWidget method openDrillDownObject.
/**
* Open drill-down object for currently selected object
*
* @param object
*/
private void openDrillDownObject(AbstractObject object) {
long objectId = (object instanceof NetworkMap) ? object.getObjectId() : object.getDrillDownObjectId();
if (objectId == 0)
return;
Object test = ConsoleSharedData.getSession().findObjectById(objectId);
if (test instanceof NetworkMap) {
if (test != null) {
history.push(currentMapId);
setContent((NetworkMap) test, false);
viewer.showBackButton(new Runnable() {
@Override
public void run() {
goBack();
}
});
}
}
if (viewPart != null && test instanceof Dashboard) {
try {
viewPart.getSite().getPage().showView("org.netxms.ui.eclipse.dashboard.views.DashboardView", Long.toString(objectId), IWorkbenchPage.VIEW_ACTIVATE);
} catch (PartInitException e) {
MessageDialogHelper.openError(viewPart.getSite().getShell(), Messages.get().AbstractNetworkMapView_Error, String.format("Cannot open drill-down object view: %s", e.getMessage()));
}
}
}
use of org.netxms.client.objects.NetworkMap in project netxms by netxms.
the class NetworkMapWidget method goBack.
/**
* Go back map history
*/
private void goBack() {
if (history.isEmpty())
return;
long submapId = history.pop();
NetworkMap map = ConsoleSharedData.getSession().findObjectById(submapId, NetworkMap.class);
if (map != null) {
setContent(map, false);
}
if (history.isEmpty())
viewer.hideBackButton();
}
Aggregations