ContentProposalAdapter behaves different in RAP [message #1796257] |
Tue, 09 October 2018 09:21 |
Flavio Donze Messages: 211 Registered: July 2009 Location: Switzerland |
Senior Member |
|
|
I have a component which I use in RAP and RCP using ContentProposalAdapter for auto-complete functionality.
This component also has a KeyListener reacting on SWT.CR.
In RCP the KeyListener is executed before
IContentProposalListener.proposalAccepted() and in RAP the opposite.
After some debugging I found the cause of this behavior in:
org.eclipse.jface.fieldassist.ContentProposalAdapter.ContentProposalPopup.TargetControlListener
After L250 there is a whole section commented out, in RCP this is active code:
// RAP [bm]: KeyEvents
// // Traverse events are handled depending on whether the
// // event has a character.
// if (e.type == SWT.Traverse) {
// // If the traverse event contains a legitimate character,
// // then we must set doit false so that the widget will
// // receive the key event. We return immediately so that
// // the character is handled only in the key event.
// // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=132101
// if (key != 0) {
// e.doit = false;
// return;
// }
// // Traversal does not contain a character. Set doit true
// // to indicate TRAVERSE_NONE will occur and that no key
// // event will be triggered. We will check for navigation
// // keys below.
// e.detail = SWT.TRAVERSE_NONE;
// e.doit = true;
// } else {
// // Default is to only propagate when configured that way.
// // Some keys will always set doit to false anyway.
// e.doit = propagateKeys;
// }
Should I rather report a bug for this, since it's on purpose?
What would be the possible side effects of a workaround like:
Listener[] listeners = text.getListeners(SWT.Traverse);
for (Listener l : listeners) {
text.removeListener(SWT.Traverse, l);
}
Prozessmanagement und Qualitätsmanagement Software QMS/IMS
https://www.scodi.ch
|
|
|
|
Powered by
FUDForum. Page generated in 0.03258 seconds