本文整理汇总了Java中com.intellij.openapi.editor.markup.EffectType.STRIKEOUT属性的典型用法代码示例。如果您正苦于以下问题:Java EffectType.STRIKEOUT属性的具体用法?Java EffectType.STRIKEOUT怎么用?Java EffectType.STRIKEOUT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.openapi.editor.markup.EffectType
的用法示例。
在下文中一共展示了EffectType.STRIKEOUT属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testScopeBased
public void testScopeBased() throws Exception {
NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.SCOPE_SOURCE, null));
NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.SCOPE_LIBRARY, null));
NamedScopeManager scopeManager = NamedScopeManager.getInstance(getProject());
scopeManager.addScope(xScope);
scopeManager.addScope(utilScope);
EditorColorsManager manager = EditorColorsManager.getInstance();
EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
manager.addColorsScheme(scheme);
EditorColorsManager.getInstance().setGlobalScheme(scheme);
TextAttributesKey xKey = ScopeAttributesUtil.getScopeTextAttributeKey(xScope.getName());
TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, EffectType.BOXED, Font.ITALIC);
scheme.setAttributes(xKey, xAttributes);
TextAttributesKey utilKey = ScopeAttributesUtil.getScopeTextAttributeKey(utilScope.getName());
TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD);
scheme.setAttributes(utilKey, utilAttributes);
try {
testFile(BASE_PATH + "/scopeBased/x/X.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test();
}
finally {
scopeManager.removeAllSets();
}
}
示例2: testScopeBased
public void testScopeBased() throws Exception {
NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.SCOPE_SOURCE, null));
NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.SCOPE_LIBRARY, null));
NamedScopeManager scopeManager = NamedScopeManager.getInstance(getProject());
scopeManager.addScope(xScope);
scopeManager.addScope(utilScope);
EditorColorsManager manager = EditorColorsManager.getInstance();
EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
manager.addColorsScheme(scheme);
EditorColorsManager.getInstance().setGlobalScheme(scheme);
TextAttributesKey xKey = ColorAndFontOptions.getScopeTextAttributeKey(xScope.getName());
TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, EffectType.BOXED, Font.ITALIC);
scheme.setAttributes(xKey, xAttributes);
TextAttributesKey utilKey = ColorAndFontOptions.getScopeTextAttributeKey(utilScope.getName());
TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD);
scheme.setAttributes(utilKey, utilAttributes);
try {
testFile(BASE_PATH + "/scopeBased/x/X.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test();
}
finally {
scopeManager.removeAllSets();
}
}
示例3: testSharedScopeBased
public void testSharedScopeBased() throws Exception {
NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.SCOPE_ANY, null));
NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.SCOPE_LIBRARY, null));
NamedScopesHolder scopeManager = DependencyValidationManager.getInstance(getProject());
scopeManager.addScope(xScope);
scopeManager.addScope(utilScope);
EditorColorsManager manager = EditorColorsManager.getInstance();
EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
manager.addColorsScheme(scheme);
EditorColorsManager.getInstance().setGlobalScheme(scheme);
TextAttributesKey xKey = ScopeAttributesUtil.getScopeTextAttributeKey(xScope.getName());
TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, null, Font.ITALIC);
scheme.setAttributes(xKey, xAttributes);
TextAttributesKey utilKey = ScopeAttributesUtil.getScopeTextAttributeKey(utilScope.getName());
TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD);
scheme.setAttributes(utilKey, utilAttributes);
NamedScope projectScope = PackagesScopesProvider.getInstance(myProject).getProjectProductionScope();
TextAttributesKey projectKey = ScopeAttributesUtil.getScopeTextAttributeKey(projectScope.getName());
TextAttributes projectAttributes = new TextAttributes(null, null, Color.blue, EffectType.BOXED, Font.ITALIC);
scheme.setAttributes(projectKey, projectAttributes);
try {
testFile(BASE_PATH + "/scopeBased/x/Shared.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test();
}
finally {
scopeManager.removeAllSets();
}
}
示例4: fromTextAttributes
@NotNull
public static SimpleTextAttributes fromTextAttributes(TextAttributes attributes) {
if (attributes == null) return REGULAR_ATTRIBUTES;
Color foregroundColor = attributes.getForegroundColor();
if (foregroundColor == null) foregroundColor = REGULAR_ATTRIBUTES.getFgColor();
int style = attributes.getFontType();
if (attributes.getEffectColor() != null) {
EffectType effectType = attributes.getEffectType();
if (effectType == EffectType.STRIKEOUT) {
style |= STYLE_STRIKEOUT;
}
else if (effectType == EffectType.WAVE_UNDERSCORE) {
style |= STYLE_WAVED;
}
else if (effectType == EffectType.LINE_UNDERSCORE ||
effectType == EffectType.BOLD_LINE_UNDERSCORE ||
effectType == EffectType.BOLD_DOTTED_LINE) {
style |= STYLE_UNDERLINE;
}
else if (effectType == EffectType.SEARCH_MATCH) {
style |= STYLE_SEARCH_MATCH;
}
else {
// not supported
}
}
return new SimpleTextAttributes(attributes.getBackgroundColor(), foregroundColor, attributes.getEffectColor(), style);
}
示例5: toTextAttributes
public TextAttributes toTextAttributes() {
Color effectColor;
EffectType effectType;
if (isWaved()) {
effectColor = myWaveColor;
effectType = EffectType.WAVE_UNDERSCORE;
}
else if (isStrikeout()) {
effectColor = myWaveColor;
effectType = EffectType.STRIKEOUT;
}
else if (isUnderline()) {
effectColor = myWaveColor;
effectType = EffectType.LINE_UNDERSCORE;
}
else if (isBoldDottedLine()) {
effectColor = myWaveColor;
effectType = EffectType.BOLD_DOTTED_LINE;
}
else if (isSearchMatch()) {
effectColor = myWaveColor;
effectType = EffectType.SEARCH_MATCH;
}
else {
effectColor = null;
effectType = null;
}
return new TextAttributes(myFgColor, null, effectColor, effectType, myStyle & FONT_MASK);
}
示例6: testSharedScopeBased
public void testSharedScopeBased() throws Exception {
NamedScope xScope = new NamedScope("xxx", new PatternPackageSet("x..*", PatternPackageSet.SCOPE_ANY, null));
NamedScope utilScope = new NamedScope("util", new PatternPackageSet("java.util.*", PatternPackageSet.SCOPE_LIBRARY, null));
NamedScopesHolder scopeManager = DependencyValidationManager.getInstance(getProject());
scopeManager.addScope(xScope);
scopeManager.addScope(utilScope);
EditorColorsManager manager = EditorColorsManager.getInstance();
EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
manager.addColorsScheme(scheme);
EditorColorsManager.getInstance().setGlobalScheme(scheme);
TextAttributesKey xKey = ColorAndFontOptions.getScopeTextAttributeKey(xScope.getName());
TextAttributes xAttributes = new TextAttributes(Color.cyan, Color.darkGray, Color.blue, null, Font.ITALIC);
scheme.setAttributes(xKey, xAttributes);
TextAttributesKey utilKey = ColorAndFontOptions.getScopeTextAttributeKey(utilScope.getName());
TextAttributes utilAttributes = new TextAttributes(Color.gray, Color.magenta, Color.orange, EffectType.STRIKEOUT, Font.BOLD);
scheme.setAttributes(utilKey, utilAttributes);
NamedScope projectScope = PackagesScopesProvider.getInstance(myProject).getProjectProductionScope();
TextAttributesKey projectKey = ColorAndFontOptions.getScopeTextAttributeKey(projectScope.getName());
TextAttributes projectAttributes = new TextAttributes(null, null, Color.blue, EffectType.BOXED, Font.ITALIC);
scheme.setAttributes(projectKey, projectAttributes);
try {
testFile(BASE_PATH + "/scopeBased/x/Shared.java").projectRoot(BASE_PATH + "/scopeBased").checkSymbolNames().test();
}
finally {
scopeManager.removeAllSets();
}
}
示例7: fromTextAttributes
@Nonnull
public static SimpleTextAttributes fromTextAttributes(TextAttributes attributes) {
if (attributes == null) return REGULAR_ATTRIBUTES;
Color foregroundColor = attributes.getForegroundColor();
if (foregroundColor == null) foregroundColor = REGULAR_ATTRIBUTES.getFgColor();
int style = attributes.getFontType();
if (attributes.getEffectColor() != null) {
EffectType effectType = attributes.getEffectType();
if (effectType == EffectType.STRIKEOUT) {
style |= STYLE_STRIKEOUT;
}
else if (effectType == EffectType.WAVE_UNDERSCORE) {
style |= STYLE_WAVED;
}
else if (effectType == EffectType.LINE_UNDERSCORE ||
effectType == EffectType.BOLD_LINE_UNDERSCORE ||
effectType == EffectType.BOLD_DOTTED_LINE) {
style |= STYLE_UNDERLINE;
}
else if (effectType == EffectType.SEARCH_MATCH) {
style |= STYLE_SEARCH_MATCH;
}
else {
// not supported
}
}
return new SimpleTextAttributes(attributes.getBackgroundColor(), foregroundColor, attributes.getEffectColor(), style);
}
示例8: getEffectPainter
protected EffectPainter getEffectPainter(EffectType type) {
if (type == EffectType.STRIKEOUT) return EffectPainter.STRIKE_THROUGH;
if (type == EffectType.WAVE_UNDERSCORE) return EffectPainter.WAVE_UNDERSCORE;
if (type == EffectType.LINE_UNDERSCORE) return EffectPainter.LINE_UNDERSCORE;
if (type == EffectType.BOLD_LINE_UNDERSCORE) return EffectPainter.BOLD_LINE_UNDERSCORE;
if (type == EffectType.BOLD_DOTTED_LINE) return EffectPainter.BOLD_DOTTED_UNDERSCORE;
return null;
}
示例9: strikeout
private static TextAttributes strikeout() {
Color color = EditorColorsManager.getInstance().getGlobalScheme().getDefaultForeground();
return new TextAttributes(null, null, color, EffectType.STRIKEOUT, 0);
}
示例10: reset
public void reset(ColorAndFontDescription description) {
if (description.isFontEnabled()) {
myLabelFont.setEnabled(true);
myCbBold.setEnabled(true);
myCbItalic.setEnabled(true);
int fontType = description.getFontType();
myCbBold.setSelected((fontType & Font.BOLD) != 0);
myCbItalic.setSelected((fontType & Font.ITALIC) != 0);
}
else {
myLabelFont.setEnabled(false);
myCbBold.setSelected(false);
myCbBold.setEnabled(false);
myCbItalic.setSelected(false);
myCbItalic.setEnabled(false);
}
updateColorChooser(myCbForeground, myForegroundChooser, description.isForegroundEnabled(),
description.isForegroundChecked(), description.getForegroundColor());
updateColorChooser(myCbBackground, myBackgroundChooser, description.isBackgroundEnabled(),
description.isBackgroundChecked(), description.getBackgroundColor());
updateColorChooser(myCbErrorStripe, myErrorStripeColorChooser, description.isErrorStripeEnabled(),
description.isErrorStripeChecked(), description.getErrorStripeColor());
EffectType effectType = description.getEffectType();
updateColorChooser(myCbEffects, myEffectsColorChooser, description.isEffectsColorEnabled(),
description.isEffectsColorChecked(), description.getEffectColor());
if (description.isEffectsColorEnabled() && description.isEffectsColorChecked()) {
myEffectsCombo.setEnabled(true);
updatingEffects = true;
if (effectType == EffectType.BOXED) {
myEffectsCombo.setSelectedItem(BORDERED_EFFECT);
}
else if (effectType == EffectType.LINE_UNDERSCORE) {
myEffectsCombo.setSelectedItem(UNDERSCORED_EFFECT);
}
else if (effectType == EffectType.WAVE_UNDERSCORE) {
myEffectsCombo.setSelectedItem(UNDERWAVED_EFFECT);
}
else if (effectType == EffectType.BOLD_LINE_UNDERSCORE) {
myEffectsCombo.setSelectedItem(BOLD_UNDERSCORED_EFFECT);
}
else if (effectType == EffectType.STRIKEOUT) {
myEffectsCombo.setSelectedItem(STRIKEOUT_EFFECT);
}
else if (effectType == EffectType.BOLD_DOTTED_LINE) {
myEffectsCombo.setSelectedItem(BOLD_DOTTED_LINE_EFFECT);
}
else {
myEffectsCombo.setSelectedItem(null);
}
updatingEffects = false;
}
else {
myEffectsCombo.setEnabled(false);
}
setInheritanceLabel(description);
}