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


Java MarkupModel.removeAllHighlighters方法代码示例

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


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

示例1: testRangeHighlightersRecreateBug

import com.intellij.openapi.editor.markup.MarkupModel; //导入方法依赖的package包/类
public void testRangeHighlightersRecreateBug() throws Exception {
  Document document = EditorFactory.getInstance().createDocument("[xxxxxxxxxxxxxx]");

  MarkupModel markupModel = DocumentMarkupModel.forDocument(document, ourProject, true);
  for (int i=0; i<2; i++) {
    RangeMarker m = markupModel.addRangeHighlighter(1, 6, 0, null, HighlighterTargetArea.EXACT_RANGE);
    RangeMarker m2 = markupModel.addRangeHighlighter(2, 7, 0, null, HighlighterTargetArea.EXACT_RANGE);
    RangeMarker m3 = markupModel.addRangeHighlighter(1, 6, 0, null, HighlighterTargetArea.EXACT_RANGE);
    markupModel.removeAllHighlighters();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:RangeMarkerTest.java

示例2: testRangeHighlighterDisposeVsRemoveAllConflict

import com.intellij.openapi.editor.markup.MarkupModel; //导入方法依赖的package包/类
public void testRangeHighlighterDisposeVsRemoveAllConflict() throws Exception {
  Document document = EditorFactory.getInstance().createDocument("[xxxxxxxxxxxxxx]");

  MarkupModel markupModel = DocumentMarkupModel.forDocument(document, ourProject, true);
  RangeMarker m = markupModel.addRangeHighlighter(1, 6, 0, null, HighlighterTargetArea.EXACT_RANGE);
  assertTrue(m.isValid());
  markupModel.removeAllHighlighters();
  assertFalse(m.isValid());
  assertEmpty(markupModel.getAllHighlighters());
  m.dispose();
  assertFalse(m.isValid());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:RangeMarkerTest.java

示例3: clearInputEditorHighlighters

import com.intellij.openapi.editor.markup.MarkupModel; //导入方法依赖的package包/类
/**
 * Clear all input highlighters
 */
public void clearInputEditorHighlighters() {
	Editor editor = getInputEditor();
	if ( editor==null ) return;

	MarkupModel markupModel = editor.getMarkupModel();
	markupModel.removeAllHighlighters();
}
 
开发者ID:antlr,项目名称:intellij-plugin-v4,代码行数:11,代码来源:InputPanel.java

示例4: updateTitle

import com.intellij.openapi.editor.markup.MarkupModel; //导入方法依赖的package包/类
@Override
protected void updateTitle(@Nullable final PsiVariable variable, final String value) {
  final PsiElement declarationScope = variable != null ? ((PsiParameter)variable).getDeclarationScope() : null;
  if (declarationScope instanceof PsiMethod) {
    final PsiMethod psiMethod = (PsiMethod)declarationScope;
    final StringBuilder buf = new StringBuilder();
    buf.append(psiMethod.getName()).append(" (");
    boolean frst = true;
    final List<TextRange> ranges2Remove = new ArrayList<TextRange>();
    TextRange addedRange = null;
    for (PsiParameter parameter : psiMethod.getParameterList().getParameters()) {
      if (frst) {
        frst = false;
      }
      else {
        buf.append(", ");
      }
      int startOffset = buf.length();
      if (myMustBeFinal || myPanel.isGenerateFinal()) {
        buf.append("final ");
      }
      buf.append(parameter.getType().getPresentableText()).append(" ").append(variable == parameter ? value : parameter.getName());
      int endOffset = buf.length();
      if (variable == parameter) {
        addedRange = new TextRange(startOffset, endOffset);
      }
      else if (myPanel.isParamToRemove(parameter)) {
        ranges2Remove.add(new TextRange(startOffset, endOffset));
      }
    }

    buf.append(")");
    setPreviewText(buf.toString());
    final MarkupModel markupModel = DocumentMarkupModel.forDocument(getPreviewEditor().getDocument(), myProject, true);
    markupModel.removeAllHighlighters();
    for (TextRange textRange : ranges2Remove) {
      markupModel.addRangeHighlighter(textRange.getStartOffset(), textRange.getEndOffset(), 0, getTestAttributesForRemoval(), HighlighterTargetArea.EXACT_RANGE);
    }
    markupModel.addRangeHighlighter(addedRange.getStartOffset(), addedRange.getEndOffset(), 0, getTextAttributesForAdd(), HighlighterTargetArea.EXACT_RANGE);
    revalidate();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:InplaceIntroduceParameterPopup.java

示例5: erase

import com.intellij.openapi.editor.markup.MarkupModel; //导入方法依赖的package包/类
public static void erase(@Nullable Project project, @NotNull Document document) {
  MarkupModel model = DocumentMarkupModel.forDocument(document, project, true);
  model.removeAllHighlighters();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:UnifiedEditorRangeHighlighter.java

示例6: erase

import com.intellij.openapi.editor.markup.MarkupModel; //导入方法依赖的package包/类
public static void erase(@Nullable Project project, @Nonnull Document document) {
  MarkupModel model = DocumentMarkupModel.forDocument(document, project, true);
  model.removeAllHighlighters();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:UnifiedEditorRangeHighlighter.java


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