Search in sources :

Example 1 with NodeListComparator

use of org.netxms.ui.eclipse.objectview.objecttabs.helpers.NodeListComparator in project netxms by netxms.

the class NodesTab method createTabContent.

/* (non-Javadoc)
	 * @see org.netxms.ui.eclipse.objectview.objecttabs.ObjectTab#createTabContent(org.eclipse.swt.widgets.Composite)
	 */
@Override
protected void createTabContent(Composite parent) {
    final String[] names = { Messages.get().NodesTab_ColId, Messages.get().NodesTab_ColName, Messages.get().NodesTab_ColPrimaryIP, Messages.get().NodesTab_ColRack, Messages.get().NodesTab_ColPlatform, Messages.get().NodesTab_ColAgentVersion, Messages.get().NodesTab_ColSysDescr, Messages.get().NodesTab_ColStatus };
    final int[] widths = { 60, 150, 100, 150, 150, 100, 300, 100 };
    viewer = new SortableTableViewer(parent, names, widths, COLUMN_NAME, SWT.UP, SWT.FULL_SELECTION | SWT.MULTI);
    viewer.setLabelProvider(new NodeListLabelProvider());
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setComparator(new NodeListComparator());
    viewer.getTable().setHeaderVisible(true);
    viewer.getTable().setLinesVisible(true);
    // $NON-NLS-1$
    WidgetHelper.restoreTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), "NodeTable.V2");
    viewer.getTable().addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            // $NON-NLS-1$
            WidgetHelper.saveColumnSettings(viewer.getTable(), Activator.getDefault().getDialogSettings(), "NodeTable.V2");
        }
    });
    createActions();
    createPopupMenu();
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) NodeListComparator(org.netxms.ui.eclipse.objectview.objecttabs.helpers.NodeListComparator) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SortableTableViewer(org.netxms.ui.eclipse.widgets.SortableTableViewer) NodeListLabelProvider(org.netxms.ui.eclipse.objectview.objecttabs.helpers.NodeListLabelProvider) DisposeEvent(org.eclipse.swt.events.DisposeEvent)

Aggregations

ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 NodeListComparator (org.netxms.ui.eclipse.objectview.objecttabs.helpers.NodeListComparator)1 NodeListLabelProvider (org.netxms.ui.eclipse.objectview.objecttabs.helpers.NodeListLabelProvider)1 SortableTableViewer (org.netxms.ui.eclipse.widgets.SortableTableViewer)1