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


Java RangeHighlighter.setGreedyToLeft方法代码示例

本文整理汇总了Java中com.intellij.openapi.editor.markup.RangeHighlighter.setGreedyToLeft方法的典型用法代码示例。如果您正苦于以下问题:Java RangeHighlighter.setGreedyToLeft方法的具体用法?Java RangeHighlighter.setGreedyToLeft怎么用?Java RangeHighlighter.setGreedyToLeft使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.editor.markup.RangeHighlighter的用法示例。


在下文中一共展示了RangeHighlighter.setGreedyToLeft方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addHighlights

import com.intellij.openapi.editor.markup.RangeHighlighter; //导入方法依赖的package包/类
private static void addHighlights(List<TextRange> ranges, Editor editor, ArrayList<RangeHighlighter> highlighters) {
    EditorColorsManager colorsManager = EditorColorsManager.getInstance();
    TextAttributes attributes = colorsManager.getGlobalScheme().getAttributes(EditorColors.WRITE_SEARCH_RESULT_ATTRIBUTES);
    HighlightManager highlightManager = HighlightManager.getInstance(editor.getProject());
    Iterator iterator = ranges.iterator();

    while (iterator.hasNext()) {
        TextRange range = (TextRange) iterator.next();
        //highlightManager.addOccurrenceHighlight(editor, range.getStartOffset() + 1, range.getEndOffset() - 1, attributes, 0, highlighters, (Color) null);
        highlightManager.addRangeHighlight(editor, range.getStartOffset() + 1, range.getEndOffset() - 1, attributes, false, highlighters);
    }

    iterator = highlighters.iterator();

    while (iterator.hasNext()) {
        RangeHighlighter highlighter = (RangeHighlighter) iterator.next();
        highlighter.setGreedyToLeft(true);
        highlighter.setGreedyToRight(true);
    }

}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:22,代码来源:FlowInPlaceRenamer.java

示例2: getSegmentHighlighter

import com.intellij.openapi.editor.markup.RangeHighlighter; //导入方法依赖的package包/类
private RangeHighlighter getSegmentHighlighter(int segmentNumber, boolean isSelected, boolean isEnd) {
  final TextAttributes lvAttr = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(EditorColors.LIVE_TEMPLATE_ATTRIBUTES);
  TextAttributes attributes = isSelected ? lvAttr : new TextAttributes();
  TextAttributes endAttributes = new TextAttributes();

  int start = mySegments.getSegmentStart(segmentNumber);
  int end = mySegments.getSegmentEnd(segmentNumber);
  RangeHighlighter segmentHighlighter = myEditor.getMarkupModel()
    .addRangeHighlighter(start, end, HighlighterLayer.LAST + 1, isEnd ? endAttributes : attributes, HighlighterTargetArea.EXACT_RANGE);
  segmentHighlighter.setGreedyToLeft(true);
  segmentHighlighter.setGreedyToRight(true);
  return segmentHighlighter;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:TemplateState.java

示例3: addHighlights

import com.intellij.openapi.editor.markup.RangeHighlighter; //导入方法依赖的package包/类
protected void addHighlights(@NotNull Map<TextRange, TextAttributes> ranges,
                             @NotNull Editor editor,
                             @NotNull Collection<RangeHighlighter> highlighters,
                             @NotNull HighlightManager highlightManager) {
  for (Map.Entry<TextRange, TextAttributes> entry : ranges.entrySet()) {
    TextRange range = entry.getKey();
    TextAttributes attributes = entry.getValue();
    highlightManager.addOccurrenceHighlight(editor, range.getStartOffset(), range.getEndOffset(), attributes, 0, highlighters, null);
  }

  for (RangeHighlighter highlighter : highlighters) {
    highlighter.setGreedyToLeft(true);
    highlighter.setGreedyToRight(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:InplaceRefactoring.java

示例4: addHighlights

import com.intellij.openapi.editor.markup.RangeHighlighter; //导入方法依赖的package包/类
private static void addHighlights(List<TextRange> ranges, Editor editor, ArrayList<RangeHighlighter> highlighters) {
  EditorColorsManager colorsManager = EditorColorsManager.getInstance();
  final TextAttributes attributes = colorsManager.getGlobalScheme().getAttributes(EditorColors.WRITE_SEARCH_RESULT_ATTRIBUTES);

  final HighlightManager highlightManager = HighlightManager.getInstance(editor.getProject());
  for (final TextRange range : ranges) {
    highlightManager.addOccurrenceHighlight(editor, range.getStartOffset(), range.getEndOffset(), attributes, 0, highlighters, null);
  }

  for (RangeHighlighter highlighter : highlighters) {
    highlighter.setGreedyToLeft(true);
    highlighter.setGreedyToRight(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:XmlTagInplaceRenamer.java

示例5: setTabStopHighlightersGreedy

import com.intellij.openapi.editor.markup.RangeHighlighter; //导入方法依赖的package包/类
public void setTabStopHighlightersGreedy(boolean greedy) {
  for (RangeHighlighter highlighter : myTabStopHighlighters) {
    highlighter.setGreedyToLeft(greedy);
    highlighter.setGreedyToRight(greedy);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:TemplateState.java


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