public void handleEvent( Event event ) { StyleRange style1 = new StyleRange(); style1.start = 0; style1.length = 4; style1.underline = false; helpLabel.setStyleRange( style1 ); helpLabel.setForeground( new Color( display, 0, 94, 170 ) ); } } );
public void handleEvent( Event event ) { StyleRange style1 = new StyleRange(); style1.start = 0; style1.length = 4; style1.underline = true; helpLabel.setStyleRange( style1 ); helpLabel.setForeground( new Color( display, 0, 0, 0 ) ); helpLabel.setCursor( new Cursor( display, SWT.CURSOR_HAND ) ); } } );
@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 ); } } }
helpLabel.setForeground( new Color( display, 0, 94, 170 ) ); FormData helpLabelFormData = new FormData(); helpLabelFormData.left = new FormAttachment( 0, 40 );
@Override public void setForegroundColor(Color foreground) { fText.setForeground(foreground); }
@Override public void setForegroundColor(Color foreground) { fText.setForeground(foreground); }
@Override public void setForegroundColor(Color foreground) { fText.setForeground(foreground); }
@Override public void setForegroundColor(Color foreground) { super.setForegroundColor(foreground); fText.setForeground(foreground); }
@Override public void setForegroundColor(Color foreground) { super.setForegroundColor(foreground); fText.setForeground(foreground); }
@Override protected void setForeground(Color color) { fViewer.getTextWidget().setForeground(color); }
public void focusLost(FocusEvent e) { if( searchText.getText().length() == 0 ) { searchText.setForeground( searchTipColor ); searchText.setText(SEARCH_TEXT_TIP); } } };
public void setForegroundColor(Color color) { StyledText te= getSourceViewer().getTextWidget(); if (te != null) te.setForeground(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; }
public void focusGained(FocusEvent e) { if (searchText.isDisposed()) return; if( isShowingSearchTip() ) { searchText.setForeground( defaultSearchColor ); if( SEARCH_TEXT_TIP.equals(searchText.getText()) ) searchText.setText(""); } }
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 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 static StyledText createStyledText(final Composite parent, final String text, final int color, final boolean grabExcessHorizontalSpace) { final StyledText styledText = new StyledText(parent, SWT.WRAP); styledText.setEnabled(false); styledText.setDoubleClickEnabled(false); styledText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, grabExcessHorizontalSpace, false)); styledText.setEditable(false); styledText.setText(text); styledText.setForeground(createColor(color)); return styledText; }
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; } }