本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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);
}
}