Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Why must press "Enter" for ComboBoxCellEditor?
Why must press "Enter" for ComboBoxCellEditor? [message #510162] Tue, 26 January 2010 15:08 Go to next message
Eclipse User
Originally posted by: yoduderoo.netscape.net

Hi,
I have a table with ComboBoxCellEditor cells. When the user selects an
option from the drop-down list, theuser must then press "Enter".

Is there a way to use ComboBoxCellEditor such that the user must not
press "Enter". That is, the selection is equivalent to select+enter?

Thanks, y
Re: Why must press "Enter" for ComboBoxCellEditor? [message #511006 is a reply to message #510162] Fri, 29 January 2010 14:10 Go to previous messageGo to next message
Eclipse User
Originally posted by: yoduderoo.netscape.net

I solved it by the following, although I am not sure if it is the
"right" way:

Control control = comboboxEditor.getControl();
CCombo c = (CCombo) control;
c.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) { }
public void widgetSelected(SelectionEvent e) {
doSomething();
}
});

Yodude wrote:
> Hi,
> I have a table with ComboBoxCellEditor cells. When the user selects an
> option from the drop-down list, theuser must then press "Enter".
>
> Is there a way to use ComboBoxCellEditor such that the user must not
> press "Enter". That is, the selection is equivalent to select+enter?
>
> Thanks, y
Re: Why must press "Enter" for ComboBoxCellEditor? [message #514879 is a reply to message #511006] Wed, 17 February 2010 00:12 Go to previous messageGo to next message
Eric Jain is currently offline Eric Jain
Messages: 266
Registered: July 2009
Senior Member
Eclipse User wrote on Fri, 29 January 2010 09:10
Originally posted by: yoduderoo.netscape.net

I solved it by the following, although I am not sure if it is the
"right" way:

Control control = comboboxEditor.getControl();
CCombo c = (CCombo) control;
c.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) { }
public void widgetSelected(SelectionEvent e) {
doSomething();
}
});



This works, but you can no longer use the up/down keys to select menu items.

Note that instead of doSomething, you can also call comboboxEditor.deactivate() and keep all the logic to handle the change in EditingSupport.setValue(...).
Re: Why must press "Enter" for ComboBoxCellEditor? [message #514882 is a reply to message #514879] Wed, 17 February 2010 00:24 Go to previous message
Eric Jain is currently offline Eric Jain
Messages: 266
Registered: July 2009
Senior Member
See also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=285612
Previous Topic:How to control a TableViewer's size?
Next Topic:Adding a MouseTrackListener to a TreeViewerColumn
Goto Forum:
  


Current Time: Sat Sep 20 01:59:01 GMT 2014

Powered by FUDForum. Page generated in 0.03053 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software