import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; public class SnippetLinkNotAccessible { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout()); Composite comp = new Composite(shell, SWT.NONE); comp.setLayout(new GridLayout(1, true)); comp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Text text = new Text(comp, SWT.None); text.setLayoutData(new GridData()); text.setText("Press Tab to test the link"); Link link = new Link(comp, SWT.NONE); link.setText("Test Link"); link.setLayoutData(new GridData()); link.setEnabled(false); link.setEnabled(true); Composite comp1 = new Composite(shell, SWT.NONE); comp1.setLayout(new GridLayout(1, true)); comp1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Text text1 = new Text(comp1, SWT.None); text1.setLayoutData(new GridData()); text1.setText("Press Shift Tab to test the link"); shell.pack(); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } }