本文整理汇总了Java中com.intellij.openapi.editor.markup.EffectType.SEARCH_MATCH属性的典型用法代码示例。如果您正苦于以下问题:Java EffectType.SEARCH_MATCH属性的具体用法?Java EffectType.SEARCH_MATCH怎么用?Java EffectType.SEARCH_MATCH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.intellij.openapi.editor.markup.EffectType
的用法示例。
在下文中一共展示了EffectType.SEARCH_MATCH属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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);
}