Community
Participate
Working Groups
Problem Description: It is impossible to distinguish between a read-only text field and an editable text field, if the text field is created by org.eclipse.ui.forms.widgets.FormToolkit. Example program to reproduce this: package text.swt; 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.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.forms.widgets.FormToolkit; public class SampleControl { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout()); shell.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); FormToolkit formToolKit = new FormToolkit(display); Composite rootComposite = formToolKit.createComposite(shell); rootComposite.setLayout(new GridLayout(2, false)); rootComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label label1 = formToolKit.createLabel(rootComposite, "Editable Text"); Text editableText = formToolKit.createText(rootComposite, "The user can edit the value of this field."); editableText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Label label2 = formToolKit.createLabel(rootComposite, "Read-Only Text"); Text readOnlyText = formToolKit.createText(rootComposite, "The user cannot edit the value of this field.", SWT.READ_ONLY); readOnlyText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); formToolKit.paintBordersFor(rootComposite); shell.pack(); shell.open(); while(!shell.isDisposed()) { if(!display.readAndDispatch()) display.sleep(); } } }
*** This bug has been marked as a duplicate of 69801 ***