Search in sources :

Example 1 with RadioInterfaceLabelProvider

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

the class RadioInterfaces 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().RadioInterfaces_ColApName, Messages.get().RadioInterfaces_ColApMac, Messages.get().RadioInterfaces_ColApVendor, Messages.get().RadioInterfaces_ColApModel, Messages.get().RadioInterfaces_ColApSerial, Messages.get().RadioInterfaces_ColRadioIndex, Messages.get().RadioInterfaces_ColRadioName, Messages.get().RadioInterfaces_ColRadioMac, Messages.get().RadioInterfaces_ColChannel, Messages.get().RadioInterfaces_ColTxPowerDbm, Messages.get().RadioInterfaces_ColTxPowerMw };
    final int[] widths = { 120, 100, 140, 140, 100, 90, 120, 100, 90, 90, 90 };
    viewer = new SortableTableViewer(parent, names, widths, 1, SWT.UP, SWT.FULL_SELECTION | SWT.MULTI);
    viewer.setContentProvider(new ArrayContentProvider());
    viewer.setLabelProvider(new RadioInterfaceLabelProvider());
    viewer.setComparator(new RadioInterfaceComparator());
    // $NON-NLS-1$
    WidgetHelper.restoreTableViewerSettings(viewer, Activator.getDefault().getDialogSettings(), "RadioInterfaces");
    viewer.getTable().addDisposeListener(new DisposeListener() {

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

Aggregations

ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 DisposeEvent (org.eclipse.swt.events.DisposeEvent)1 DisposeListener (org.eclipse.swt.events.DisposeListener)1 RadioInterfaceComparator (org.netxms.ui.eclipse.topology.views.helpers.RadioInterfaceComparator)1 RadioInterfaceLabelProvider (org.netxms.ui.eclipse.topology.views.helpers.RadioInterfaceLabelProvider)1 SortableTableViewer (org.netxms.ui.eclipse.widgets.SortableTableViewer)1