Search in sources :

Example 1 with TabbedObjectView

use of org.netxms.ui.eclipse.objectview.views.TabbedObjectView in project netxms by netxms.

the class SummaryTableWidget method showObjectDetails.

/**
 * Show details for selected object
 */
private void showObjectDetails() {
    IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
    if (selection.size() != 1)
        return;
    AbstractObject object = ((ObjectWrapper) selection.getFirstElement()).getObject();
    if (object != null) {
        try {
            TabbedObjectView view = (TabbedObjectView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(TabbedObjectView.ID);
            view.setObject(object);
        } catch (PartInitException e) {
            MessageDialogHelper.openError(getShell(), Messages.get().SummaryTableWidget_Error, String.format(Messages.get().SummaryTableWidget_CannotOpenObjectDetails, e.getLocalizedMessage()));
        }
    }
}
Also used : TabbedObjectView(org.netxms.ui.eclipse.objectview.views.TabbedObjectView) AbstractObject(org.netxms.client.objects.AbstractObject) ObjectWrapper(org.netxms.ui.eclipse.objects.ObjectWrapper) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PartInitException(org.eclipse.ui.PartInitException)

Example 2 with TabbedObjectView

use of org.netxms.ui.eclipse.objectview.views.TabbedObjectView in project netxms by netxms.

the class AlarmList method showObjectDetails.

/**
 * Show details for selected object
 */
private void showObjectDetails() {
    IStructuredSelection selection = (IStructuredSelection) alarmViewer.getSelection();
    if (selection.size() != 1)
        return;
    AbstractObject object = session.findObjectById(((Alarm) selection.getFirstElement()).getSourceObjectId());
    if (object != null) {
        try {
            TabbedObjectView view = (TabbedObjectView) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(TabbedObjectView.ID);
            view.setObject(object);
        } catch (PartInitException e) {
            MessageDialogHelper.openError(getShell(), Messages.get().AlarmList_Error, Messages.get().AlarmList_OpenDetailsError + e.getLocalizedMessage());
        }
    }
}
Also used : TabbedObjectView(org.netxms.ui.eclipse.objectview.views.TabbedObjectView) AbstractObject(org.netxms.client.objects.AbstractObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 PartInitException (org.eclipse.ui.PartInitException)2 AbstractObject (org.netxms.client.objects.AbstractObject)2 TabbedObjectView (org.netxms.ui.eclipse.objectview.views.TabbedObjectView)2 ObjectWrapper (org.netxms.ui.eclipse.objects.ObjectWrapper)1