Beispiel #1
0
 void createStyledText() {
   text =
       new org.eclipse.swt.custom.StyledText(
           shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
   org.eclipse.swt.layout.GridData spec = new org.eclipse.swt.layout.GridData();
   spec.horizontalAlignment = GridData.FILL;
   spec.grabExcessHorizontalSpace = true;
   spec.verticalAlignment = GridData.FILL;
   spec.grabExcessVerticalSpace = true;
   text.setLayoutData(spec);
   text.addLineStyleListener(lineStyler);
   text.setEditable(false);
   org.eclipse.swt.graphics.Color bg = Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
   text.setBackground(bg);
 }