Search in sources :

Example 6 with ComboBoxPainter

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);
}
Also used : ComboBoxPainter(org.eclipse.nebula.widgets.nattable.painter.cell.ComboBoxPainter) ComboBoxCellEditor(org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor)

Aggregations

ComboBoxPainter (org.eclipse.nebula.widgets.nattable.painter.cell.ComboBoxPainter)6 ComboBoxCellEditor (org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor)5 AbstractRegistryConfiguration (org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration)2 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)2 PricingTypeBean (org.eclipse.nebula.widgets.nattable.dataset.fixture.data.PricingTypeBean)2 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)2 SpanningDataLayer (org.eclipse.nebula.widgets.nattable.layer.SpanningDataLayer)2 CheckBoxPainter (org.eclipse.nebula.widgets.nattable.painter.cell.CheckBoxPainter)2 EventList (ca.odell.glazedlists.EventList)1 FilterList (ca.odell.glazedlists.FilterList)1 SortedList (ca.odell.glazedlists.SortedList)1 TransformedList (ca.odell.glazedlists.TransformedList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)1 ConfigRegistry (org.eclipse.nebula.widgets.nattable.config.ConfigRegistry)1 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)1 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)1 DefaultBooleanDisplayConverter (org.eclipse.nebula.widgets.nattable.data.convert.DefaultBooleanDisplayConverter)1 CheckBoxCellEditor (org.eclipse.nebula.widgets.nattable.edit.editor.CheckBoxCellEditor)1