use of org.eclipse.nebula.widgets.nattable.painter.cell.ComboBoxPainter in project nebula.widgets.nattable by eclipse.
the class EditorConfiguration method registerColumnTwelveComboBox.
/**
* The following will register a ComboBoxCellEditor for the column that
* carries the favourite drinks information. The difference to the editor in
* column eight is that the text control of the combobox is editable and the
* combobox shows all entries instead of a scrollbar. It also uses a
* different icon for rendering the combo in normal mode.
*
* @param configRegistry
*/
private void registerColumnTwelveComboBox(IConfigRegistry configRegistry) {
// register a combobox for the city names
ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(Arrays.asList(PersonService.getDrinkList()), -1);
comboBoxCellEditor.setFreeEdit(true);
comboBoxCellEditor.setMultiselect(true);
comboBoxCellEditor.setIconImage(GUIHelper.getImage("plus"));
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor, DisplayMode.EDIT, EditorExample.COLUMN_TWELVE_LABEL);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new ComboBoxPainter(GUIHelper.getImage("plus")), DisplayMode.NORMAL, EditorExample.COLUMN_TWELVE_LABEL);
}
Aggregations