/** * 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; }
/** * 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; }
/** * 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; }
@Override public TextStyle keywordTextStyle() { TextStyle textStyle = defaultTextStyle().copy(); textStyle.setColor(new RGB(14, 48, 131)); textStyle.setStyle(SWT.BOLD); return textStyle; }
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); }
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); }
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); }
/** * 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; } }); }
/** * @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; }
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); }
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); }
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); }
@Override public TextStyle keywordTextStyle() { final TextStyle textStyle = defaultTextStyle().copy(); textStyle.setColor(new RGB(127, 0, 85)); textStyle.setStyle(SWT.NONE); return textStyle; }
@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; }
@Override public TextStyle commentTextStyle() { final TextStyle textStyle = defaultTextStyle().copy(); textStyle.setFontData(GamaFonts.getNavigFolderFont().getFontData()); textStyle.setColor(new RGB(63, 127, 95)); return textStyle; }
@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); }
@Override public TextStyle commentTextStyle() { TextStyle textStyle = defaultTextStyle().copy(); textStyle.setColor(new RGB(128, 128, 128)); textStyle.setStyle(SWT.ITALIC); return textStyle; }
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); }
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); }
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; }
private TextStyle hubNameStyle() { TextStyle _textStyle = new TextStyle(); final TextStyle textStyle = _textStyle; RGB _rGB = new RGB(0, 0, 0); textStyle.setColor(_rGB); return textStyle; }
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; }
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; }
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); }
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; }
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); }
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); }
private Color createInactiveColor() { TextStyle commentTextStyle = new TextStyle(); preferenceStoreAccessor.populateTextStyle(HighlightingStyles.COMMENT_ID, commentTextStyle, DEFAULT_HIGHLIGHTING_CONFIGURATION.commentTextStyle()); return new Color(getDisplay(), commentTextStyle.getColor()); }
/** * Default style for annotations, colored magenta. */ private TextStyle annotationTextStyle() { TextStyle textStyle = defaultTextStyle().copy(); textStyle.setColor(new RGB(255, 0, 255)); return textStyle; }
/** * Default style for type references, colored dark grey. */ private TextStyle typeRefTextStyle() { TextStyle textStyle = defaultTextStyle().copy(); textStyle.setColor(new RGB(140, 140, 140)); return textStyle; }
/** * 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; }
/** * 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; }
@Override public TextStyle numberTextStyle() { return literalTextStyle(); }
public void incluirTipo(IHighlightingConfigurationAcceptor acceptor, String s, RGB rgbT) { TextStyle estiloTexto = new TextStyle(); estiloTexto.setBackgroundColor(rgbT); acceptor.acceptDefaultHighlighting(s, s, estiloTexto); }
/** * Constructor. */ protected AbstractSyntaxColoringAssertion(final TextStyle textStyle) { this.textStyle = textStyle; }