Search in sources :

Example 1 with ConnectionPointComparator

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

the class HostSearchResults 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().HostSearchResults_ColSeq, Messages.get().HostSearchResults_ColNode, Messages.get().HostSearchResults_ColIface, Messages.get().HostSearchResults_ColMac, Messages.get().HostSearchResults_ColIp, Messages.get().HostSearchResults_ColSwitch, Messages.get().HostSearchResults_ColPort, Messages.get().HostSearchResults_ColType };
    final int[] widths = { 70, 120, 120, 90, 90, 120, 120, 60 };
    viewer = new SortableTableViewer(parent, names, widths, COLUMN_SEQUENCE, SWT.UP, SWT.MULTI | SWT.FULL_SELECTION);
    viewer.setContentProvider(new ArrayContentProvider());
    ConnectionPointLabelProvider labelProvider = new ConnectionPointLabelProvider();
    viewer.setLabelProvider(labelProvider);
    viewer.setComparator(new ConnectionPointComparator(labelProvider));
    WidgetHelper.restoreTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), TABLE_CONFIG_PREFIX);
    viewer.getTable().addDisposeListener(new DisposeListener() {

        @Override
        public void widgetDisposed(DisposeEvent e) {
            WidgetHelper.saveTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), TABLE_CONFIG_PREFIX);
        }
    });
    createActions();
    contributeToActionBars();
    createPopupMenu();
}
Also used : ConnectionPointLabelProvider(org.netxms.ui.eclipse.topology.views.helpers.ConnectionPointLabelProvider) DisposeListener(org.eclipse.swt.events.DisposeListener) ConnectionPointComparator(org.netxms.ui.eclipse.topology.views.helpers.ConnectionPointComparator) 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 ConnectionPointComparator (org.netxms.ui.eclipse.topology.views.helpers.ConnectionPointComparator)1 ConnectionPointLabelProvider (org.netxms.ui.eclipse.topology.views.helpers.ConnectionPointLabelProvider)1 SortableTableViewer (org.netxms.ui.eclipse.widgets.SortableTableViewer)1