Search in sources :

Example 1 with ReportTreeContentProvider

use of org.netxms.ui.eclipse.reporter.widgets.internal.ReportTreeContentProvider in project netxms by netxms.

the class ReportNavigator method createPartControl.

/* (non-Javadoc)
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 */
@Override
public void createPartControl(Composite parent) {
    session = (NXCSession) ConsoleSharedData.getSession();
    reportTree = new TreeViewer(parent, SWT.NONE);
    reportTree.setContentProvider(new ReportTreeContentProvider());
    reportTree.setLabelProvider(new ReportTreeLabelProvider());
    // reportTree.setInput(session);
    createActions();
    contributeToActionBars();
    createPopupMenu();
    getSite().setSelectionProvider(reportTree);
    sessionListener = new SessionListener() {

        @Override
        public void notificationHandler(SessionNotification n) {
            if ((n.getCode() == SessionNotification.OBJECT_CHANGED) && (n.getObject() instanceof DashboardRoot)) {
                reportTree.getTree().getDisplay().asyncExec(new Runnable() {

                    @Override
                    public void run() {
                        refresh();
                    }
                });
            }
        }
    };
    session.addListener(sessionListener);
    refresh();
}
Also used : ReportTreeLabelProvider(org.netxms.ui.eclipse.reporter.widgets.internal.ReportTreeLabelProvider) TreeViewer(org.eclipse.jface.viewers.TreeViewer) DashboardRoot(org.netxms.client.objects.DashboardRoot) SessionListener(org.netxms.client.SessionListener) ReportTreeContentProvider(org.netxms.ui.eclipse.reporter.widgets.internal.ReportTreeContentProvider) SessionNotification(org.netxms.client.SessionNotification)

Aggregations

TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 SessionListener (org.netxms.client.SessionListener)1 SessionNotification (org.netxms.client.SessionNotification)1 DashboardRoot (org.netxms.client.objects.DashboardRoot)1 ReportTreeContentProvider (org.netxms.ui.eclipse.reporter.widgets.internal.ReportTreeContentProvider)1 ReportTreeLabelProvider (org.netxms.ui.eclipse.reporter.widgets.internal.ReportTreeLabelProvider)1