ComboBoxCellEditor - get rid of a textbox?

I have TableViewer

c ComboBoxCellEditor

. When I click on a cell, I first get a textbox (similar to TextCellEditor

) with an arrow next to it. If I click the arrow, I get a dropdown with the values ​​that I insert into it.

Is there a way to skip the textbox step? I want it to immediately open the combo box when I click / move to a cell. Along with that, I also don't want to allow any options other than those listed.

I thought this behavior was style controlled, but the only styles I found were

/**
 * The list is dropped down when the activation is done through the mouse
 */
public static final int DROP_DOWN_ON_MOUSE_ACTIVATION = 1;

/**
 * The list is dropped down when the activation is done through the keyboard
 */
public static final int DROP_DOWN_ON_KEY_ACTIVATION = 1 << 1;

/**
 * The list is dropped down when the activation is done without
 * ui-interaction
 */
public static final int DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION = 1 << 2;

/**
 * The list is dropped down when the activation is done by traversing from
 * cell to cell
 */
public static final int DROP_DOWN_ON_TRAVERSE_ACTIVATION = 1 << 3;

      

and they didn't seem to be relevant. In fact, I installed all of them and I was unable to get the functionality I am looking for.

How can I show showbox without accompanying textbox?

+3


source to share


1 answer


You can change the style of the main Combo widget using the constructor:

ComboBoxCellEditor(Composite parent, String[] items, int style) 

      



and conveying SWT.READ_ONLY

as style

0


source







All Articles