I think you want to select Label text on the clipboard.
You can use Text Widget as a label, but clicking on it will display a carriage. If you do not want to use a carriage, use StyledText and set the carriage to null.
Example:
package testplugin; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; public class SWTHelloWorld { public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell(display); shell.setLayout(new GridLayout()); Label labelWidget = new Label(shell, SWT.NONE); labelWidget.setText("Hello"); Text textWidget = new Text(shell, SWT.NONE); textWidget.setText("Hello");
You can link to these links to listen for the mouse, keyboard, focus, etc. etc. on different widgets.
source share