@Override public void setEnabled( boolean enabled ) { styledText.setEnabled( enabled ); // StyledText component does not get the "disabled" look, so it needs to be applied explicitly // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=4745 if ( Display.getDefault() != null ) { Color foreground = Display.getDefault().getSystemColor( enabled ? SWT.COLOR_BLACK : SWT.COLOR_DARK_GRAY ); Color background = Display.getDefault().getSystemColor( enabled ? SWT.COLOR_WHITE : SWT.COLOR_WIDGET_BACKGROUND ); styledText.setForeground( foreground ); styledText.setBackground( background ); } } }
@Override public void setBackgroundColor(Color background) { fText.setBackground(background); }
@Override public void setBackgroundColor(Color background) { fText.setBackground(background); }
@Override public void setBackgroundColor(Color background) { fText.setBackground(background); }
@Override public void setBackgroundColor(Color background) { fText.setBackground(background); }
@Override public void setBackgroundColor(Color background) { super.setBackgroundColor(background); fText.setBackground(background); }
@Override protected void setBackground(Color color) { fViewer.getTextWidget().setBackground(color); }
@Override public void setBackgroundColor(Color background) { super.setBackgroundColor(background); fText.setBackground(background); }
@Override protected void setBackground(Color color) { fViewer.getTextWidget().setBackground(color); }
public void setBackgroundColor(Color color) { StyledText te= getTextWidget(); if (te != null) te.setBackground(color); if (fLineNumberColumn != null) fLineNumberColumn.setBackground(color); }
private StyledText createCodeView(Composite parent) { int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION; StyledText styledText= new StyledText(parent, styles); styledText.setBackground(fBackgroundColor); styledText.setForeground(fForegroundColor); styledText.setEditable(false); return styledText; }
private StyledText createCodeView(Composite parent) { int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION; StyledText styledText= new StyledText(parent, styles); styledText.setBackground(fBackgroundColor); styledText.setForeground(fForegroundColor); styledText.setEditable(false); return styledText; }
private StyledText createCodeView(Composite parent) { int styles= SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI | SWT.FULL_SELECTION; StyledText styledText= new StyledText(parent, styles); styledText.setBackground(fBackgroundColor); styledText.setForeground(fForegroundColor); styledText.setEditable(false); return styledText; }
public void setBackgroundColor(Color color) { StyledText te= getSourceViewer().getTextWidget(); if (te != null) te.setBackground(color); if (fLineNumberColumn != null) fLineNumberColumn.setBackground(color); }
private StyledText createText(Composite parent, String text) { StyledText widget = new StyledText(parent, SWT.READ_ONLY | SWT.MULTI); GridData data= new GridData(GridData.FILL_HORIZONTAL); widget.setLayoutData(data); if (text != null) widget.setText(text); widget.setBackground(fBackgroundColor); widget.setForeground(fForegroundColor); widget.setCaret(null); return widget; }
private StyledText createText(Composite parent, String text) { StyledText widget = new StyledText(parent, SWT.READ_ONLY | SWT.MULTI); GridData data= new GridData(GridData.FILL_HORIZONTAL); widget.setLayoutData(data); if (text != null) widget.setText(text); widget.setBackground(fBackgroundColor); widget.setForeground(fForegroundColor); widget.setCaret(null); return widget; }
public void setEnabled(boolean enabled) { if (enabled != fEnabled) { fEnabled= enabled; StyledText c= getTextWidget(); if (c != null) { c.setEnabled(enabled); Display d= c.getDisplay(); c.setBackground(enabled ? d.getSystemColor(SWT.COLOR_LIST_BACKGROUND) : null); } } }
void createStyledText() { text = new StyledText (shell, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL); GridData spec = new GridData(); spec.horizontalAlignment = GridData.FILL; spec.grabExcessHorizontalSpace = true; spec.verticalAlignment = GridData.FILL; spec.grabExcessVerticalSpace = true; text.setLayoutData(spec); text.addLineStyleListener(lineStyler); text.setEditable(false); Color bg = Display.getDefault().getSystemColor(SWT.COLOR_GRAY); text.setBackground(bg); }
public void setEnabled(boolean enabled) { if (enabled != fEnabled) { fEnabled= enabled; StyledText c= getSourceViewer().getTextWidget(); if (c != null) { c.setEnabled(enabled); Display d= c.getDisplay(); if (enabled) { c.setBackground(d.getSystemColor(SWT.COLOR_LIST_BACKGROUND)); } } } }
protected Control createDialogArea(Composite parent) { GridData gd = new GridData(GridData.FILL_BOTH); StyledText text = new StyledText(parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL); text.setLayoutData(gd); text.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND)); text.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND)); text.setText(resultString); return text; } }