Search in sources :

Example 1 with SoftwarePackageComparator

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

the class SoftwareInventory method createTableViewer.

/**
 * Create viewer for table mode
 */
private void createTableViewer() {
    viewer = new SortableTableViewer(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 ArrayContentProvider());
    viewer.setLabelProvider(new SoftwarePackageLabelProvider(false));
    viewer.setComparator(new SoftwarePackageComparator());
    if (menuManager != null) {
        Menu menu = menuManager.createContextMenu(viewer.getControl());
        viewer.getControl().setMenu(menu);
        viewPart.getSite().registerContextMenu(menuManager, viewer);
    }
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) SoftwarePackageComparator(org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageComparator) SoftwarePackageLabelProvider(org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageLabelProvider) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SortableTableViewer(org.netxms.ui.eclipse.widgets.SortableTableViewer) Menu(org.eclipse.swt.widgets.Menu) DisposeEvent(org.eclipse.swt.events.DisposeEvent)

Example 2 with SoftwarePackageComparator

use of org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageComparator 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)2 DisposeListener (org.eclipse.swt.events.DisposeListener)2 Menu (org.eclipse.swt.widgets.Menu)2 SoftwarePackageComparator (org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageComparator)2 SoftwarePackageLabelProvider (org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwarePackageLabelProvider)2 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 SoftwareInventoryContentProvider (org.netxms.ui.eclipse.objectview.widgets.helpers.SoftwareInventoryContentProvider)1 SortableTableViewer (org.netxms.ui.eclipse.widgets.SortableTableViewer)1 SortableTreeViewer (org.netxms.ui.eclipse.widgets.SortableTreeViewer)1