Community
Participate
Working Groups
Build Identifier: 3.5.2 org.eclipse.jface.text.contentassist.ICompletionListener.selectionChanged() is called whenever the user presses a key which causes a selection change, however, it is not called when the same is done using the mouse. Expectation is that selectionChanged() abstracts from the concrete input device (like in any SWT selection change event). We use the selectionChanged notification to get the currently selected proposal. What we actually want to have is a additional shortcut, e.g. Shift+Enter/double-click to insert the selection proposal in a different way. Do you have any ideas on how to achieve this? Reproducible: Always
JFace Text code is owned by the Text component.
>What we actually want to have is a additional shortcut, e.g. >Shift+Enter/double-click to insert the selection proposal in a different way. >Do you have any ideas on how to achieve this? I see two things you could try: 1. Register a display filter (Display.addFilter(*)) and remember when your key binding is pressed. In ICompletionProposal.apply(*) check the remembered state. 2. Define a command that's always available and register your key binding for it. Then add a command listener that detects when the command got executed. Alternatively you could register an empty action for that command that just remembers the execution. In ICompletionProposal.apply(*) check the remembered state. For both solutions you should reset the state in ICompletionListener.assistSessionStarted(*). *** This bug has been marked as a duplicate of bug 272284 ***