[Grid] ComboBoxCellEditor doesn't return focus to the Grid [message #59585] |
Sat, 27 September 2008 19:03  |
Eclipse User |
|
|
|
This time I think I'm on a "real" problem.
I have two kinds of celleditors which I use in my Grid:
- TextCellEditor
- ComboBoxCellEditor
I'm currently implementing keyboard only input. The eclipse 3.3 editing
support stuff is very nice. When I validated/cancel a TextCellEditor
(through ret/esc) focus is returned to the cell and it has a thick black
rectangle around it indicating selection. I can then move to the next cell
with the arrow keys.
When I validate/cancel a ComboBoxCellEditor, the combobox disappears and
the cell appears to be back to normal, but the selection rectangle is
thin. The grid appears to no longer have keyboard focus.
I really don't understand GUI programming very well. I notice that
ComboBoxCellEditor has this snippet:
comboBox.addTraverseListener(new TraverseListener() {
public void keyTraversed(TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_ESCAPE
|| e.detail == SWT.TRAVERSE_RETURN) {
e.doit = false;
}
}
});
Might this e.doit = false; be the culprit? What is this code there for? If
I understand correctly, it prevents the event from bubbling up?
Regards
Greg
|
|
|
Re: [Grid] ComboBoxCellEditor doesn't return focus to the Grid [message #59778 is a reply to message #59585] |
Tue, 30 September 2008 11:23  |
Eclipse User |
|
|
|
Solved with a custom editor which wraps around ComboBoxCellEditor and has:
public void deactivate() {
super.deactivate();
comboBox.getParent().forceFocus();
}
But surely there's a better way (and I don't mean putting the same code in
an AfterDeactivationListener)?
Should I raise the issue on platform.swt? Is it linked to my being on
macosX?
Regards
Greg
Gregory Dyke wrote:
> This time I think I'm on a "real" problem.
> I have two kinds of celleditors which I use in my Grid:
> - TextCellEditor
> - ComboBoxCellEditor
> I'm currently implementing keyboard only input. The eclipse 3.3 editing
> support stuff is very nice. When I validated/cancel a TextCellEditor
> (through ret/esc) focus is returned to the cell and it has a thick black
> rectangle around it indicating selection. I can then move to the next cell
> with the arrow keys.
> When I validate/cancel a ComboBoxCellEditor, the combobox disappears and
> the cell appears to be back to normal, but the selection rectangle is
> thin. The grid appears to no longer have keyboard focus.
> I really don't understand GUI programming very well. I notice that
> ComboBoxCellEditor has this snippet:
> comboBox.addTraverseListener(new TraverseListener() {
> public void keyTraversed(TraverseEvent e) {
> if (e.detail == SWT.TRAVERSE_ESCAPE
> || e.detail == SWT.TRAVERSE_RETURN) {
> e.doit = false;
> }
> }
> });
> Might this e.doit = false; be the culprit? What is this code there for? If
> I understand correctly, it prevents the event from bubbling up?
> Regards
> Greg
|
|
|
Re: [Grid] ComboBoxCellEditor doesn't return focus to the Grid [message #592458 is a reply to message #59585] |
Tue, 30 September 2008 11:23  |
Eclipse User |
|
|
|
Solved with a custom editor which wraps around ComboBoxCellEditor and has:
public void deactivate() {
super.deactivate();
comboBox.getParent().forceFocus();
}
But surely there's a better way (and I don't mean putting the same code in
an AfterDeactivationListener)?
Should I raise the issue on platform.swt? Is it linked to my being on
macosX?
Regards
Greg
Gregory Dyke wrote:
> This time I think I'm on a "real" problem.
> I have two kinds of celleditors which I use in my Grid:
> - TextCellEditor
> - ComboBoxCellEditor
> I'm currently implementing keyboard only input. The eclipse 3.3 editing
> support stuff is very nice. When I validated/cancel a TextCellEditor
> (through ret/esc) focus is returned to the cell and it has a thick black
> rectangle around it indicating selection. I can then move to the next cell
> with the arrow keys.
> When I validate/cancel a ComboBoxCellEditor, the combobox disappears and
> the cell appears to be back to normal, but the selection rectangle is
> thin. The grid appears to no longer have keyboard focus.
> I really don't understand GUI programming very well. I notice that
> ComboBoxCellEditor has this snippet:
> comboBox.addTraverseListener(new TraverseListener() {
> public void keyTraversed(TraverseEvent e) {
> if (e.detail == SWT.TRAVERSE_ESCAPE
> || e.detail == SWT.TRAVERSE_RETURN) {
> e.doit = false;
> }
> }
> });
> Might this e.doit = false; be the culprit? What is this code there for? If
> I understand correctly, it prevents the event from bubbling up?
> Regards
> Greg
|
|
|
Powered by
FUDForum. Page generated in 0.08368 seconds