/** * Creates a {@link Label} | {@link Combo} control. The combo is initialised from the given {@link Key} * @param parent * @param label * @param key */ protected Combo createComboControl(Composite parent, String label, Key key) { Label lbl = new Label(parent, SWT.NONE); GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, true, false); lbl.setLayoutData(gd); lbl.setText(label); Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY); gd = new GridData(GridData.END, GridData.CENTER, false, false); combo.setLayoutData(gd); ControlData data = new ControlData(key, SEVERITIES); combo.setData(data); combo.setItems(SEVERITIES_LABELS); combo.addSelectionListener(selectionlistener); combo.select(data.getSelection(key.getStoredValue(fLookupOrder, false, fManager))); addHighlight(parent, lbl, combo); return combo; }
/** * Creates a {@link Label} | {@link Combo} control. The combo is initialised * from the given {@link Key} * * @param parent * @param label * @param key */ protected Combo createComboControl(Composite parent, String label, Key key) { Label lbl = new Label(parent, SWT.NONE); GridData gd = new GridData(GridData.BEGINNING, GridData.CENTER, true, false); lbl.setLayoutData(gd); lbl.setText(label); Combo combo = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY); gd = new GridData(GridData.END, GridData.CENTER, false, false); combo.setLayoutData(gd); ControlData data = new ControlData(key, SEVERITIES); combo.setData(data); combo.setItems(SEVERITIES_LABELS); combo.addSelectionListener(selectionlistener); combo.select(data.getSelection(key.getStoredValue(fLookupOrder, false, fManager))); addHighlight(parent, lbl, combo); fLabel = lbl; return combo; }