当前位置: 首页>>代码示例>>Java>>正文


Java EffectType.SEARCH_MATCH属性代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:SimpleTextAttributes.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:SimpleTextAttributes.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:30,代码来源:SimpleTextAttributes.java


注:本文中的com.intellij.openapi.editor.markup.EffectType.SEARCH_MATCH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。