本文整理汇总了Java中org.eclipse.xtext.ui.editor.utils.TextStyle.setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:Java TextStyle.setBackgroundColor方法的具体用法?Java TextStyle.setBackgroundColor怎么用?Java TextStyle.setBackgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.xtext.ui.editor.utils.TextStyle
的用法示例。
在下文中一共展示了TextStyle.setBackgroundColor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}
示例4: 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);
}
示例5: 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
示例6: configure
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入方法依赖的package包/类
@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);
}
示例7: addType
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入方法依赖的package包/类
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);
}
示例8: addType
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入方法依赖的package包/类
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);
}
示例9: populateTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入方法依赖的package包/类
public void populateTextStyle(String id, TextStyle style, TextStyle defaults) {
// prepare
String colorKey = PREFERENCE_TAG + PreferenceStoreAccessor.getTokenColorPreferenceKey(id);
String backgroundKey = PREFERENCE_TAG + getTokenBackgroundColorPreferenceKey(id);
String fontKey = PREFERENCE_TAG + getTokenFontPreferenceKey(id);
String styleKey = PREFERENCE_TAG + getTokenStylePreferenceKey(id);
// DefaultDefault
IPreferenceStore editorsStore = EditorsUI.getPreferenceStore();
RGB fontColorDefaultDefault = editorsStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT) ? getDisplay()
.getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB()
: PreferenceConverter.getColor(editorsStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND);
RGB backgrounColorDefaultDefault = editorsStore
.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) ? getDisplay().getSystemColor(
SWT.COLOR_LIST_BACKGROUND).getRGB() : PreferenceConverter.getColor(editorsStore,
AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
FontData[] fontDataDefaultDefault = JFaceResources.getTextFont().getFontData();
// set defaults
IPreferenceStore preferenceStore = getPreferenceStore();
if (defaults.getColor() != null)
PreferenceConverter.setDefault(preferenceStore, colorKey, defaults.getColor());
else {
PreferenceConverter.setDefault(preferenceStore, colorKey, fontColorDefaultDefault);
}
if (defaults.getBackgroundColor() != null)
PreferenceConverter.setDefault(preferenceStore, backgroundKey, defaults.getBackgroundColor());
else {
PreferenceConverter.setDefault(preferenceStore, backgroundKey, backgrounColorDefaultDefault);
}
if (defaults.getFontData() != null)
PreferenceConverter.setDefault(preferenceStore, fontKey, defaults.getFontData());
else {
PreferenceConverter.setDefault(preferenceStore, fontKey, fontDataDefaultDefault);
}
preferenceStore.setDefault(styleKey, defaults.getStyle());
// populate
RGB color = PreferenceConverter.getColor(preferenceStore, colorKey);
if (!color.equals(fontColorDefaultDefault))
style.setColor(color);
RGB background = PreferenceConverter.getColor(preferenceStore, backgroundKey);
if (!background.equals(backgrounColorDefaultDefault))
style.setBackgroundColor(background);
FontData[] fontDataArray = PreferenceConverter.getFontDataArray(preferenceStore, fontKey);
if (!Arrays.equals(fontDataArray, fontDataDefaultDefault)) {
style.setFontData(fontDataArray);
}
style.setStyle(preferenceStore.getInt(styleKey));
}
示例10: numberTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入方法依赖的package包/类
@Override
public TextStyle numberTextStyle() {
TextStyle textStyle = defaultTextStyle().copy();
textStyle.setBackgroundColor(new RGB(230, 240, 255));
return textStyle;
}
示例11: stringTextStyle
import org.eclipse.xtext.ui.editor.utils.TextStyle; //导入方法依赖的package包/类
@Override
public TextStyle stringTextStyle() {
TextStyle textStyle = defaultTextStyle().copy();
textStyle.setBackgroundColor(new RGB(230, 240, 255));
return textStyle;
}