Search in sources :

Example 1 with SoftwareInventoryContentProvider

use of org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwareInventoryContentProvider in project netxms by netxms.

the class SoftwareInventory method createTreeViewer.

/**
 * Create viewer for tree mode
 */
private void createTreeViewer() {
    viewer = new SortableTreeViewer(this, names, widths, 0, SWT.UP, SWT.MULTI | SWT.FULL_SELECTION);
    WidgetHelper.restoreColumnViewerSettings(viewer, Activator.getDefault().getDialogSettings(), configPrefix);
    viewer.getControl().addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            WidgetHelper.saveColumnViewerSettings(viewer, Activator.getDefault().getDialogSettings(), configPrefix);
        }
    });
    viewer.setContentProvider(new SoftwareInventoryContentProvider());
    viewer.setLabelProvider(new SoftwarePackageLabelProvider(true));
    viewer.setComparator(new SoftwarePackageComparator());
    if (menuManager != null) {
        Menu menu = menuManager.createContextMenu(viewer.getControl());
        viewer.getControl().setMenu(menu);
        viewPart.getSite().registerContextMenu(menuManager, viewer);
    }
}
Also used : SortableTreeViewer(org.netxms.ui.eclipse.widgets.SortableTreeViewer) DisposeListener(org.eclipse.swt.events.DisposeListener) SoftwarePackageComparator(org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageComparator) SoftwarePackageLabelProvider(org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageLabelProvider) SoftwareInventoryContentProvider(org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwareInventoryContentProvider) Menu(org.eclipse.swt.widgets.Menu) DisposeEvent(org.eclipse.swt.events.DisposeEvent)

Aggregations

DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 Menu (org.eclipse.swt.widgets.Menu)1 SoftwareInventoryContentProvider (org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwareInventoryContentProvider)1 SoftwarePackageComparator (org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageComparator)1 SoftwarePackageLabelProvider (org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageLabelProvider)1 SortableTreeViewer (org.netxms.ui.eclipse.widgets.SortableTreeViewer)1