Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » ContentProposalAdapter behaves different in RAP
ContentProposalAdapter behaves different in RAP [message #1796257] Tue, 09 October 2018 09:21 Go to next message
Flavio Donze is currently offline Flavio DonzeFriend
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
Re: ContentProposalAdapter behaves different in RAP [message #1796272 is a reply to message #1796257] Tue, 09 October 2018 12:12 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
the original (RCP) implementation of ContentProposalAdapter is heavily based on key events. Due to client-server architecture of RAP and usual network latency, ContentProposalAdapter in RAP does not work in the same way as in RCP. That's why we developed a custom component AutoSuggest available in RAP Incubator [1]. I would suggest to use this component instead.

[1] http://git.eclipse.org/c/rap/incubator/org.eclipse.rap.incubator.dropdown.git/tree/bundles/org.eclipse.rap.addons.autosuggest

Best regards,
Ivan
Previous Topic:IColorProvider not working with CSS
Next Topic:[ANN] RAP 3.7 M1 published. Important fix for Firefox 65+!
Goto Forum:
  


Current Time: Thu Apr 18 09:27:49 GMT 2024

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

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

Back to the top