Search in sources :

Example 1 with ParamMappingLabelProvider

use of org.netxms.ui.eclipse.snmp.dialogs.helpers.ParamMappingLabelProvider in project netxms by netxms.

the class TrapConfigurationDialog method setupParameterList.

/**
 * Setup parameter mapping list
 */
private void setupParameterList() {
    Table table = paramList.getTable();
    table.setHeaderVisible(true);
    TableColumn tc = new TableColumn(table, SWT.LEFT);
    tc.setText(Messages.get().TrapConfigurationDialog_Number);
    tc.setWidth(90);
    tc = new TableColumn(table, SWT.LEFT);
    tc.setText(Messages.get().TrapConfigurationDialog_Parameter);
    tc.setWidth(200);
    pmap = new ArrayList<SnmpTrapParameterMapping>(trap.getParameterMapping());
    paramList.setContentProvider(new ArrayContentProvider());
    paramList.setLabelProvider(new ParamMappingLabelProvider(pmap));
    paramList.setInput(pmap.toArray());
    WidgetHelper.restoreColumnSettings(table, Activator.getDefault().getDialogSettings(), PARAMLIST_TABLE_SETTINGS);
    paramList.addDoubleClickListener(new IDoubleClickListener() {

        @Override
        public void doubleClick(DoubleClickEvent event) {
            editParameter();
        }
    });
}
Also used : SnmpTrapParameterMapping(org.netxms.client.snmp.SnmpTrapParameterMapping) Table(org.eclipse.swt.widgets.Table) ParamMappingLabelProvider(org.netxms.ui.eclipse.snmp.dialogs.helpers.ParamMappingLabelProvider) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) TableColumn(org.eclipse.swt.widgets.TableColumn)

Aggregations

ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 Table (org.eclipse.swt.widgets.Table)1 TableColumn (org.eclipse.swt.widgets.TableColumn)1 SnmpTrapParameterMapping (org.netxms.client.snmp.SnmpTrapParameterMapping)1 ParamMappingLabelProvider (org.netxms.ui.eclipse.snmp.dialogs.helpers.ParamMappingLabelProvider)1