Search in sources :

Example 6 with NetworkMap

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()));
        }
    }
}
Also used : Dashboard(org.netxms.client.objects.Dashboard) AbstractObject(org.netxms.client.objects.AbstractObject) NetworkMapObject(org.netxms.client.maps.elements.NetworkMapObject) PartInitException(org.eclipse.ui.PartInitException) NetworkMap(org.netxms.client.objects.NetworkMap)

Example 7 with NetworkMap

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();
}
Also used : NetworkMap(org.netxms.client.objects.NetworkMap)

Aggregations

NetworkMap (org.netxms.client.objects.NetworkMap)7 AbstractObject (org.netxms.client.objects.AbstractObject)5 Dashboard (org.netxms.client.objects.Dashboard)4 ArrayList (java.util.ArrayList)2 GridData (org.eclipse.swt.layout.GridData)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 PartInitException (org.eclipse.ui.PartInitException)2 NetworkMapObject (org.netxms.client.maps.elements.NetworkMapObject)2 AgentPolicy (org.netxms.client.objects.AgentPolicy)2 BusinessService (org.netxms.client.objects.BusinessService)2 BusinessServiceRoot (org.netxms.client.objects.BusinessServiceRoot)2 Cluster (org.netxms.client.objects.Cluster)2 Condition (org.netxms.client.objects.Condition)2 Container (org.netxms.client.objects.Container)2 DashboardGroup (org.netxms.client.objects.DashboardGroup)2 DashboardRoot (org.netxms.client.objects.DashboardRoot)2 MobileDevice (org.netxms.client.objects.MobileDevice)2 NetworkMapGroup (org.netxms.client.objects.NetworkMapGroup)2 NetworkMapRoot (org.netxms.client.objects.NetworkMapRoot)2