Community
Participate
Working Groups
If the user goes to select text in FormText control and ends up with empty selection, the control doesn't always realize that no selection happened. It might take a few tries to reproduce this. I found that it helps to start selection and then move slightly down (not enough to go to the next line) before ending the selection. You can tell that the control thinks there is a selection present by the fact that Copy menu item is enabled. It might take a few tries to get into this state, but once you are there invoking Copy causes the following exception: java.lang.IllegalArgumentException: Argument not valid at org.eclipse.swt.SWT.error(SWT.java:3865) at org.eclipse.swt.SWT.error(SWT.java:3799) at org.eclipse.swt.SWT.error(SWT.java:3770) at org.eclipse.swt.dnd.DND.error(DND.java:282) at org.eclipse.swt.dnd.DND.error(DND.java:228) at org.eclipse.swt.dnd.Clipboard.setContents(Clipboard.java:480) at org.eclipse.swt.dnd.Clipboard.setContents(Clipboard.java:411) at org.eclipse.ui.forms.widgets.FormText.copy(FormText.java:1085) at org.eclipse.ui.forms.widgets.FormText$10.widgetSelected(FormText.java:920) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3910) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3503) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.ja va:113) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:19 4) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(Ec lipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppL auncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514) at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
Created attachment 172016 [details] Patch This patch adds an extra check for empty string right before a segment is added to selection data. Would be great to see this go into Helios SR1.
I was able to reproduce while selecting in the introduction of the cheat sheet "Create a Hello World Application". I'll review your patch.
The patch is good and looks completely safe. Targeting 3.6.1.
Patch applied to HEAD, Fixed.
That last comment should have been patch applied to 3.6 maintenance stream, Fixed for 3.6.1.