Search in sources :

Example 1 with RoutingTableComparator

use of org.netxms.ui.eclipse.topology.views.helpers.RoutingTableComparator in project netxms by netxms.

the class RoutingTableView method createPartControl.

/* (non-Javadoc)
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 */
@Override
public void createPartControl(Composite parent) {
    final String[] names = { Messages.get().RoutingTableView_Destination, Messages.get().RoutingTableView_NextHop, Messages.get().RoutingTableView_Interface, Messages.get().RoutingTableView_Type };
    final int[] widths = { 180, 140, 200, 140 };
    viewer = new SortableTableViewer(parent, names, widths, COLUMN_DESTINATION, SWT.DOWN, SWT.FULL_SELECTION | SWT.MULTI);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new RoutingTableLabelProvider());
    viewer.setComparator(new RoutingTableComparator());
    // $NON-NLS-1$
    WidgetHelper.restoreTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), "RoutingTable");
    viewer.getTable().addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            // $NON-NLS-1$
            WidgetHelper.saveTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), "RoutingTable");
        }
    });
    createActions();
    contributeToActionBars();
    createPopupMenu();
    refresh();
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) RoutingTableComparator(org.netxms.ui.eclipse.topology.views.helpers.RoutingTableComparator) RoutingTableLabelProvider(org.netxms.ui.eclipse.topology.views.helpers.RoutingTableLabelProvider) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SortableTableViewer(org.netxms.ui.eclipse.widgets.SortableTableViewer) 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 RoutingTableComparator (org.netxms.ui.eclipse.topology.views.helpers.RoutingTableComparator)1 RoutingTableLabelProvider (org.netxms.ui.eclipse.topology.views.helpers.RoutingTableLabelProvider)1 SortableTableViewer (org.netxms.ui.eclipse.widgets.SortableTableViewer)1