Search in sources :

Example 1 with Dot1xPortComparator

use of org.netxms.ui.eclipse.switchmanager.views.helpers.Dot1xPortComparator in project netxms by netxms.

the class Dot1xStatusView 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().Dot1xStatusView_ColDevice, Messages.get().Dot1xStatusView_ColSlotPort, Messages.get().Dot1xStatusView_ColInterface, Messages.get().Dot1xStatusView_ColPAE, Messages.get().Dot1xStatusView_ColBackend };
    final int[] widths = { 250, 60, 180, 150, 150 };
    viewer = new SortableTableViewer(parent, names, widths, 1, SWT.UP, SWT.FULL_SELECTION | SWT.MULTI);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new Dot1xPortListLabelProvider());
    viewer.setComparator(new Dot1xPortComparator());
    // $NON-NLS-1$
    WidgetHelper.restoreTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), "Dot1xStatusView");
    viewer.getTable().addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            // $NON-NLS-1$
            WidgetHelper.saveTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), "Dot1xStatusView");
        }
    });
    createActions();
    contributeToActionBars();
    createPopupMenu();
    refresh();
}
Also used : DisposeListener(org.eclipse.swt.events.DisposeListener) Dot1xPortComparator(org.netxms.ui.eclipse.switchmanager.views.helpers.Dot1xPortComparator) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) SortableTableViewer(org.netxms.ui.eclipse.widgets.SortableTableViewer) DisposeEvent(org.eclipse.swt.events.DisposeEvent) Dot1xPortListLabelProvider(org.netxms.ui.eclipse.switchmanager.views.helpers.Dot1xPortListLabelProvider)

Aggregations

ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 Dot1xPortComparator (org.netxms.ui.eclipse.switchmanager.views.helpers.Dot1xPortComparator)1 Dot1xPortListLabelProvider (org.netxms.ui.eclipse.switchmanager.views.helpers.Dot1xPortListLabelProvider)1 SortableTableViewer (org.netxms.ui.eclipse.widgets.SortableTableViewer)1