Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » [Grid] ComboBoxCellEditor doesn't return focus to the Grid
[Grid] ComboBoxCellEditor doesn't return focus to the Grid [message #59585] Sat, 27 September 2008 23:03 Go to next message
Gregory Dyke is currently offline Gregory DykeFriend
Messages: 8
Registered: July 2009
Junior Member
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 15:23 Go to previous message
Gregory Dyke is currently offline Gregory DykeFriend
Messages: 8
Registered: July 2009
Junior Member
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 15:23 Go to previous message
Gregory Dyke is currently offline Gregory DykeFriend
Messages: 8
Registered: July 2009
Junior Member
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
Previous Topic:GridViewer - Resources
Next Topic:Grid - data into Excel
Goto Forum:
  


Current Time: Tue Apr 23 12:00:50 GMT 2024

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

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

Back to the top