Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html /
  
  package org.eclipse.xtext.ui.editor.utils;
 
 import  org.eclipse.swt.SWT;
 import  org.eclipse.swt.graphics.FontData;
 import  org.eclipse.swt.graphics.RGB;

Simple bean which is used to share text style information between components.

Author(s):
Dennis H´┐Żbner - Initial contribution and API
 
 public class TextStyle {
 	public static final int DEFAULT_FONT_STYLE = SWT.NORMAL;
 	private RGB color;
 	private RGB backgroundColor;
 	private FontData[] fontData;
 	private int style = ;
 
 	private TextStyle(TextStyle textStyle) {
 		this. = textStyle.backgroundColor;
 		this. = textStyle.color;
 		this. = textStyle.fontData;
 		this. = textStyle.style;
 	}
 
 	public TextStyle() {
 	}

Returns:
the color
 
 	public RGB getColor() {
 		return ;
 	}

Parameters:
color the color to set
 
 	public void setColor(RGB color) {
 		this. = color;
 	}

Returns:
the fontData
 
 	public FontData[] getFontData() {
 		return ;
 	}

Parameters:
fontData the fontData to set
 
 	public void setFontData(FontData... fontData) {
 		this. = fontData;
 	}

Parameters:
backgroundColor the backgroundColor to set
 
 	public void setBackgroundColor(RGB backgroundColor) {
 		this. = backgroundColor;
 	}

Returns:
the backgroundColor
 
 	public RGB getBackgroundColor() {
 		return ;
 	}

Returns:
SWT style constant (default is SWT.NORMAL)
 
 	public int getStyle() {
 		return ;
 	}

creates a new TextStyle instance and copies all the source fields
 
 	public TextStyle copy() {
 		return new TextStyle(this);
 	}

Parameters:
style SWT style constant
See also:
SWT
	public void setStyle(int style) {
		this. = style;
	}
New to GrepCode? Check out our FAQ X