Java 类org.eclipse.xtext.ui.editor.utils.TextStyle 实例源码

项目:dsl-devkit    文件:AbstractSyntaxColoringTest.java   
/**
 * Checks if the two given {@link org.eclipse.swt.graphics.TextStyle}s are equal, with respect to colors, font. Underlines and other attributes are ignored.
 *
 * @param textStyleA
 *          the first {@link org.eclipse.swt.graphics.TextStyle}
 * @param textStyleB
 *          the second {@link org.eclipse.swt.graphics.TextStyle}
 * @return {@code true} if the given {@link org.eclipse.swt.graphics.TextStyle}s are equal, {@code false} otherwise
 */
@SuppressWarnings("PMD.CompareObjectsWithEquals")
public static boolean areEqualTextStyles(final org.eclipse.swt.graphics.TextStyle textStyleA, final org.eclipse.swt.graphics.TextStyle textStyleB) {
  if (textStyleA == textStyleB) {
    return true;
  }
  if (textStyleA == null || textStyleB == null) {
    return false;
  }
  if (textStyleA.foreground != null) {
    if (!textStyleA.foreground.equals(textStyleB.foreground)) {
      return false;
    }
  } else if (textStyleB.foreground != null) {
    return false;
  }
  if (textStyleA.font != null) {
    if (!textStyleA.font.equals(textStyleB.font)) {
      return false;
    }
  } else if (textStyleB.font != null) {
    return false;
  }
  return true;
}
项目:n4js    文件:HighlightingConfiguration.java   
/**
 * Default style for all reg-ex literals, colored orange.
 */
public TextStyle regExTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(255, 128, 64)); // orange
    // textStyle.setBackgroundColor(new RGB(233, 242, 248)); // very light blue/greenish thing
    return textStyle;
}
项目:n4js    文件:HighlightingConfiguration.java   
/**
 * Default style for template delimiters, colored orange.
 */
public TextStyle templateDelimiterTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(255, 183, 51)); // light orange
    // textStyle.setBackgroundColor(new RGB(233, 242, 248)); // very light blue/greenish thing
    return textStyle;
}
项目:solidity-ide    文件:SolidityHighlightingConfiguration.java   
@Override
public TextStyle keywordTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(14, 48, 131));
    textStyle.setStyle(SWT.BOLD);
    return textStyle;
}
项目:org.xtext.dsl.restaurante    文件:RestauranteHighlightingConfiguration.java   
public void incluirTipo(IHighlightingConfigurationAcceptor acceptor, String s, RGB rgbD, RGB rgbT, int estilo) {
    TextStyle estiloTexto = new TextStyle();
    estiloTexto.setColor(rgbD);
    estiloTexto.setBackgroundColor(rgbT);
    estiloTexto.setStyle(estilo);
    //FontData f = new FontData();
    //f.setHeight(7);
    //textStyle.setFontData(f);
    acceptor.acceptDefaultHighlighting(s, s, estiloTexto);
}
项目:SurveyDSL    文件:QueryITHighlightingConfiguration.java   
public void addType( IHighlightingConfigurationAcceptor acceptor, String s, int r, int g, int b, int style )
{
 TextStyle textStyle = new TextStyle();
 textStyle.setBackgroundColor(new RGB(255, 255, 255));
 textStyle.setColor(new RGB(r, g, b));
 textStyle.setStyle(style);
 //textStyle.setFontData(new FontData("courier", 14, style));
 acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:jason-eclipse-plugin    文件:Mas2jHighlightingConfiguration.java   
public void addType( IHighlightingConfigurationAcceptor acceptor, String s, int r, int g, int b, int style) {
    TextStyle textStyle = new TextStyle();
    //textStyle.setBackgroundColor(new RGB(255, 255, 255));
    textStyle.setColor(new RGB(r, g, b));
    textStyle.setStyle(style);
    acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:jason-eclipse-plugin    文件:AslHighlightingConfiguration.java   
public void addType( IHighlightingConfigurationAcceptor acceptor, String s, int r, int g, int b, int style) {
    TextStyle textStyle = new TextStyle();
    //textStyle.setBackgroundColor(new RGB(255, 255, 255));
    textStyle.setColor(new RGB(r, g, b));
    textStyle.setStyle(style);
    acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:dsl-devkit    文件:AbstractSyntaxColoringTest.java   
/**
 * Checks the given offset for the given {@link TextStyle}.
 *
 * @param editor
 *          the {@link XtextEditor}
 * @param offset
 *          the position to check
 * @param textStyle
 *          the expected {@link TextStyle}
 * @param bot
 *          instance of swt bot
 */
public static void assertTextStyle(final XtextEditor editor, final int offset, final TextStyle textStyle, final SWTWorkbenchBot bot) {
  bot.waitUntil(new DefaultCondition() {
    @Override
    public boolean test() {
      return areEqualStyleRanges(createStyleRange(offset, 1, createTextAttribute(textStyle)), getStyleRange(editor, offset));
    }

    @Override
    public String getFailureMessage() {
      return STYLE_ASSERTION_FAILURE_MESSAGE;
    }
  });
}
项目:dsl-devkit    文件:CheckHighlightingConfiguration.java   
/**
 * @return a bluish TextStyle for JavaDoc comments
 */
public TextStyle javaDocCommentTextStyle() {
  TextStyle textStyle = defaultTextStyle().copy();
  // CHECKSTYLE:OFF
  textStyle.setColor(new RGB(63, 95, 191));
  // CHECKSTYLE:ON
  return textStyle;
}
项目:bts    文件:BTSHighlightingConfiguration.java   
public void addType(IHighlightingConfigurationAcceptor acceptor, String s,
        int r, int g, int b, int style) {
    TextStyle textStyle = new TextStyle();
    textStyle.setBackgroundColor(new RGB(255, 255, 255));
    textStyle.setColor(new RGB(r, g, b));
    textStyle.setStyle(style);
    acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:bts    文件:TextAttributeProvider.java   
protected TextAttribute createTextAttribute(String id, TextStyle defaultTextStyle) {
    TextStyle textStyle = new TextStyle();
    preferencesAccessor.populateTextStyle(id, textStyle, defaultTextStyle);
    int style = textStyle.getStyle();
    Font fontFromFontData = EditorUtils.fontFromFontData(textStyle.getFontData());
    return new TextAttribute(
            EditorUtils.colorFromRGB(textStyle.getColor()),
            EditorUtils.colorFromRGB(textStyle.getBackgroundColor()),
            style, fontFromFontData);
}
项目:statecharts    文件:SGenHighlightingConfiguration.java   
@Override
public TextStyle keywordTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(14, 48, 131));
    textStyle.setStyle(SWT.BOLD);
    return textStyle;
}
项目:statecharts    文件:SCTHighlightingConfiguration.java   
@Override
public TextStyle keywordTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(14, 48, 131));
    textStyle.setStyle(SWT.BOLD);
    return textStyle;
}
项目:PDFReporter-Studio    文件:SqlHighlightingConfiguration.java   
public void addElementConfiguration(IHighlightingConfigurationAcceptor acceptor, String s, int r, int g, int b, int style) {
    TextStyle textStyle = new TextStyle();
    textStyle.setBackgroundColor(new RGB(255, 255, 255));
    textStyle.setColor(new RGB(r, g, b));
    textStyle.setStyle(style);
    acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:PDFReporter-Studio    文件:JavaJRExpressionHighlightingConfiguration.java   
public void addElementConfiguration(IHighlightingConfigurationAcceptor acceptor, String s,
        int r, int g, int b, int style) {
    TextStyle textStyle = new TextStyle();
    textStyle.setBackgroundColor(new RGB(255, 255, 255));
    textStyle.setColor(new RGB(r, g, b));
    textStyle.setStyle(style);
    acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:gama    文件:GamlHighlightingConfiguration.java   
@Override
public TextStyle keywordTextStyle() {
    final TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(127, 0, 85));
    textStyle.setStyle(SWT.NONE);
    return textStyle;
}
项目:gama    文件:GamlHighlightingConfiguration.java   
@Override
public TextStyle taskTextStyle() {
    final TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setFontData(GamaFonts.getNavigHeaderFont().getFontData());
    textStyle.setColor(new RGB(150, 132, 106));
    textStyle.setStyle(SWT.ITALIC | SWT.BOLD);
    return textStyle;
}
项目:gama    文件:GamlHighlightingConfiguration.java   
@Override
public TextStyle commentTextStyle() {
    final TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setFontData(GamaFonts.getNavigFolderFont().getFontData());
    textStyle.setColor(new RGB(63, 127, 95));
    return textStyle;
}
项目:EASyProducer    文件:VilHighlightingConfiguration.java   
@Override
public void configure(IHighlightingConfigurationAcceptor acceptor) {
    super.configure(acceptor);
    TextStyle textStyle = new TextStyle();
    textStyle.setBackgroundColor(new RGB(255, 255, 255));
    textStyle.setColor(new RGB(42, 0, 255));
    textStyle.setFontData(new FontData("Consolas-regular", 10, SWT.BOLD));
    acceptor.acceptDefaultHighlighting(REFERRED_VARIABLES, REFERRED_VARIABLES, textStyle);
}
项目:sadlos2    文件:SadlHighlightingConfiguration.java   
@Override
public TextStyle commentTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(128, 128, 128));
    textStyle.setStyle(SWT.ITALIC);
    return textStyle;
}
项目:k3    文件:ExpHighlightingConfiguration.java   
public void addType( IHighlightingConfigurationAcceptor acceptor, String s)  {
 TextStyle textStyle = new TextStyle();
 textStyle.setBackgroundColor(new RGB(255, 255, 255));
 textStyle.setColor(new RGB(50, 0, 0));
 textStyle.setStyle(SWT.BOLD);
 acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:DialogScriptDSL    文件:DialogScriptHighlightingConfiguration.java   
public void configure(final IHighlightingConfigurationAcceptor acceptor) {
  super.configure(acceptor);
  TextStyle _myCommentTextStyle = this.myCommentTextStyle();
  acceptor.acceptDefaultHighlighting(DialogScriptHighlightingConfiguration.MY_COMMENT_ID, "SemanticComment", _myCommentTextStyle);
  TextStyle _defaultTextStyle = this.defaultTextStyle();
  acceptor.acceptDefaultHighlighting(DialogScriptHighlightingConfiguration.ID_IS_KEYWORD, "KeywordAsId", _defaultTextStyle);
  TextStyle _crossRefStringStyle = this.crossRefStringStyle();
  acceptor.acceptDefaultHighlighting(DialogScriptHighlightingConfiguration.CROSSREF_STRING, "CrossrefString", _crossRefStringStyle);
  TextStyle _sceneNameStyle = this.sceneNameStyle();
  acceptor.acceptDefaultHighlighting(DialogScriptHighlightingConfiguration.SCENE_NAME, "SceneName", _sceneNameStyle);
  TextStyle _hubNameStyle = this.hubNameStyle();
  acceptor.acceptDefaultHighlighting(DialogScriptHighlightingConfiguration.HUB_NAME, "HubName", _hubNameStyle);
}
项目:DialogScriptDSL    文件:DialogScriptHighlightingConfiguration.java   
private TextStyle crossRefStringStyle() {
  TextStyle _xblockexpression = null;
  {
    TextStyle _textStyle = new TextStyle();
    final TextStyle textStyle = _textStyle;
    RGB _rGB = new RGB(44, 44, 44);
    textStyle.setColor(_rGB);
    _xblockexpression = (textStyle);
  }
  return _xblockexpression;
}
项目:DialogScriptDSL    文件:DialogScriptHighlightingConfiguration.java   
private TextStyle hubNameStyle() {
  TextStyle _textStyle = new TextStyle();
  final TextStyle textStyle = _textStyle;
  RGB _rGB = new RGB(0, 0, 0);
  textStyle.setColor(_rGB);
  return textStyle;
}
项目:DialogScriptDSL    文件:DialogScriptHighlightingConfiguration.java   
private TextStyle sceneNameStyle() {
  TextStyle _textStyle = new TextStyle();
  final TextStyle textStyle = _textStyle;
  RGB _rGB = new RGB(0, 0, 0);
  textStyle.setColor(_rGB);
  textStyle.setStyle(SWT.BOLD);
  return textStyle;
}
项目:DialogScriptDSL    文件:DialogScriptHighlightingConfiguration.java   
private TextStyle myCommentTextStyle() {
  TextStyle _textStyle = new TextStyle();
  final TextStyle textStyle = _textStyle;
  RGB _rGB = new RGB(88, 88, 88);
  textStyle.setColor(_rGB);
  textStyle.setStyle(SWT.ITALIC);
  return textStyle;
}
项目:DialogScriptDSL    文件:CharacterScriptHighlightingConfiguration.java   
public void configure(final IHighlightingConfigurationAcceptor acceptor) {
  super.configure(acceptor);
  TextStyle _myCommentTextStyle = this.myCommentTextStyle();
  acceptor.acceptDefaultHighlighting(CharacterScriptHighlightingConfiguration.MY_COMMENT_ID, "SemanticComment", _myCommentTextStyle);
  TextStyle _featureKeywordTextStyle = this.featureKeywordTextStyle();
  acceptor.acceptDefaultHighlighting(CharacterScriptHighlightingConfiguration.FEATURE_KEYWORD, "FeatureKeyword", _featureKeywordTextStyle);
}
项目:DialogScriptDSL    文件:CharacterScriptHighlightingConfiguration.java   
public TextStyle featureKeywordTextStyle() {
  TextStyle _xblockexpression = null;
  {
    TextStyle _textStyle = new TextStyle();
    TextStyle textStyle = _textStyle;
    RGB _rGB = new RGB(129, 62, 0);
    textStyle.setColor(_rGB);
    textStyle.setStyle(SWT.ITALIC);
    _xblockexpression = (textStyle);
  }
  return _xblockexpression;
}
项目:DialogScriptDSL    文件:CharacterScriptHighlightingConfiguration.java   
private TextStyle myCommentTextStyle() {
  TextStyle _textStyle = new TextStyle();
  final TextStyle textStyle = _textStyle;
  RGB _rGB = new RGB(88, 88, 88);
  textStyle.setColor(_rGB);
  textStyle.setStyle(SWT.ITALIC);
  return textStyle;
}
项目:lil    文件:HighlightingConfiguration.java   
public void addType(final IHighlightingConfigurationAcceptor acceptor, final String s, final int r, final int g, final int b, final int style) {
  TextStyle _textStyle = new TextStyle();
  final TextStyle textStyle = _textStyle;
  RGB _rGB = new RGB(255, 255, 255);
  textStyle.setBackgroundColor(_rGB);
  RGB _rGB_1 = new RGB(r, g, b);
  textStyle.setColor(_rGB_1);
  textStyle.setStyle(style);
  acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:lil    文件:HighlightingConfiguration.java   
public void addType(final IHighlightingConfigurationAcceptor acceptor, final String s, final int r, final int g, final int b, final int br, final int bg, final int bb, final int style) {
  TextStyle _textStyle = new TextStyle();
  final TextStyle textStyle = _textStyle;
  RGB _rGB = new RGB(br, bg, bb);
  textStyle.setBackgroundColor(_rGB);
  RGB _rGB_1 = new RGB(r, g, b);
  textStyle.setColor(_rGB_1);
  textStyle.setStyle(style);
  acceptor.acceptDefaultHighlighting(s, s, textStyle);
}
项目:n4js    文件:WizardPreviewProvider.java   
private Color createInactiveColor() {
    TextStyle commentTextStyle = new TextStyle();
    preferenceStoreAccessor.populateTextStyle(HighlightingStyles.COMMENT_ID, commentTextStyle,
            DEFAULT_HIGHLIGHTING_CONFIGURATION.commentTextStyle());
    return new Color(getDisplay(), commentTextStyle.getColor());
}
项目:n4js    文件:HighlightingConfiguration.java   
/**
 * Default style for annotations, colored magenta.
 */
private TextStyle annotationTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(255, 0, 255));
    return textStyle;
}
项目:n4js    文件:HighlightingConfiguration.java   
/**
 * Default style for type references, colored dark grey.
 */
private TextStyle typeRefTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(140, 140, 140));
    return textStyle;
}
项目:n4js    文件:HighlightingConfiguration.java   
/**
 * Default style for number and string literals, colored blue.
 */
public TextStyle literalTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(0, 0, 255));
    return textStyle;
}
项目:n4js    文件:HighlightingConfiguration.java   
/**
 * Default style for number and string literals, colored blue.
 */
public TextStyle jsDocTextStyle() {
    TextStyle textStyle = defaultTextStyle().copy();
    textStyle.setColor(new RGB(90, 139, 227));
    return textStyle;
}
项目:n4js    文件:HighlightingConfiguration.java   
@Override
public TextStyle numberTextStyle() {
    return literalTextStyle();
}
项目:org.xtext.dsl.restaurante    文件:RestauranteHighlightingConfiguration.java   
public void incluirTipo(IHighlightingConfigurationAcceptor acceptor, String s, RGB rgbT) {
    TextStyle estiloTexto = new TextStyle();
    estiloTexto.setBackgroundColor(rgbT);
    acceptor.acceptDefaultHighlighting(s, s, estiloTexto);
}
项目:dsl-devkit    文件:AbstractSyntaxColoringTest.java   
/**
 * Constructor.
 */
protected AbstractSyntaxColoringAssertion(final TextStyle textStyle) {
  this.textStyle = textStyle;
}