Community
Participate
Working Groups
I add a SelectionListener using Text::addSelectionListener() but it never fires when text is selected (via the mouse or keyboard). The documentation states it fires this selection event. Is this a bug with Text or something that is not supported and the doc is just out-of-date. Please let me know as soon as you can because we'll need to find a workaround in our code (if it's possible) or document it as a know issue. Here is a small example to show the event not firing public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout()); final Text field = new Text(shell, SWT.SINGLE); field.addSelectionListener(new SelectionAdapter() { public void widgetDefaultSelected(SelectionEvent e) { System.out.println("default selection"); } public void widgetSelected(SelectionEvent e) { System.out.println("selection"); } }); shell.open(); while (shell != null && !shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } } NOTES: SN (5/17/01 6:28:23 PM) It never did because there is no support in the OS for this. The StyledText added this callback and supported it. However, the double selection callback does work in the case of a single line text widget when you hit return. Changing PR to a DCR. McQ (28/05/2001 2:14:00 PM) - Not for June. McQ (26/06/2001 1:39:21 PM) - It's now called "DefaultSelection". McQ (26/06/2001 1:40:00 PM) - Document that selection in text widget should not be Selection.
PRODUCT VERSION: 0.107 (on Windows 2000, may also happen on other platforms)
Need to either document or implement.
If StyledText supports this, then implement it for Text. See SN for info if required. If StyledText does not support it, then update the documentation.
I realize this bug is ancient and the javadoc actually does warn you that selection does nothing on Text. But this is inconsistent and annoying (I can't find another way of listening to selection changes in a text field; for example to enable/disable context menu options). Could this be considered for 3.2?
There is no support in the native Windows text control for this feature. That's what is holding this up.
*** Bug 176374 has been marked as a duplicate of this bug. ***
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.