本文整理汇总了Java中org.eclipse.xtext.ui.editor.utils.TextStyle类的典型用法代码示例。如果您正苦于以下问题:Java TextStyle类的具体用法?Java TextStyle怎么用?Java TextStyle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextStyle类属于org.eclipse.xtext.ui.editor.utils包,在下文中一共展示了TextStyle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: areEqualTextStyles
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
/**
* 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;
}
示例2: regExTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
/**
* 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;
}
示例3: templateDelimiterTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
/**
* 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;
}
示例4: keywordTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
@Override
public TextStyle keywordTextStyle() {
TextStyle textStyle = defaultTextStyle().copy();
textStyle.setColor(new RGB(14, 48, 131));
textStyle.setStyle(SWT.BOLD);
return textStyle;
}
示例5: incluirTipo
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
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);
}
示例6: addType
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
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);
}
示例7: addType
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
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);
}
示例8: assertTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
/**
* 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;
}
});
}
示例9: javaDocCommentTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
/**
* @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;
}
示例10: addType
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
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);
}
示例11: createTextAttribute
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
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);
}
示例12: addElementConfiguration
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
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);
}
示例13: addElementConfiguration
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
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);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:JavaJRExpressionHighlightingConfiguration.java
示例14: keywordTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
@Override
public TextStyle keywordTextStyle() {
final TextStyle textStyle = defaultTextStyle().copy();
textStyle.setColor(new RGB(127, 0, 85));
textStyle.setStyle(SWT.NONE);
return textStyle;
}
示例15: taskTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入依赖的package包/类
@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;
}