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