如果您对com.intellij.ui.ColoredSideBorder的实例源码和源代码示例感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解com.intellij.ui.ColoredSi
如果您对com.intellij.ui.ColoredSideBorder的实例源码和源代码示例感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解com.intellij.ui.ColoredSideBorder的实例源码的各种细节,并对源代码示例进行深入的分析,此外还有关于com.intellij.lang.cacheBuilder.DefaultWordsScanner的实例源码、com.intellij.lang.cacheBuilder.SimpleWordsScanner的实例源码、com.intellij.lang.cacheBuilder.WordsScanner的实例源码、com.intellij.openapi.editor.colors.CodeInsightColors的实例源码的实用技巧。
本文目录一览:- com.intellij.ui.ColoredSideBorder的实例源码(源代码示例)
- com.intellij.lang.cacheBuilder.DefaultWordsScanner的实例源码
- com.intellij.lang.cacheBuilder.SimpleWordsScanner的实例源码
- com.intellij.lang.cacheBuilder.WordsScanner的实例源码
- com.intellij.openapi.editor.colors.CodeInsightColors的实例源码
com.intellij.ui.ColoredSideBorder的实例源码(源代码示例)
protected JComponent createActionsToolbar(final Editor editor,final int lineNumber) { final JComponent editorComponent = editor.getComponent(); final DefaultActionGroup group = new DefaultActionGroup(); final GotoPrevIoUsCoveredLineAction prevAction = new GotoPrevIoUsCoveredLineAction(editor,lineNumber); final GotoNextCoveredLineAction nextAction = new GotoNextCoveredLineAction(editor,lineNumber); group.add(prevAction); group.add(nextAction); prevAction.registerCustomShortcutSet(new CustomShortcutSet(Keystroke.getKeystroke(KeyEvent.VK_UP,InputEvent.ALT_MASK|InputEvent.SHIFT_MASK)),editorComponent); nextAction.registerCustomShortcutSet(new CustomShortcutSet(Keystroke.getKeystroke(KeyEvent.VK_DOWN,editorComponent); final LineData lineData = getLineData(lineNumber); if (myCoverageByTestApplicable) { group.add(new ShowCoveringTestsAction(myClassName,lineData)); } final AnAction byteCodeViewAction = ActionManager.getInstance().getAction("ByteCodeViewer"); if (byteCodeViewAction != null) { group.add(byteCodeViewAction); } group.add(new EditCoverageColorsAction(editor,lineNumber)); group.add(new HideCoverageInfoAction()); final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.FILEHISTORY_VIEW_TOOLBAR,group,true); final JComponent toolbarComponent = toolbar.getComponent(); final Color background = ((EditorEx)editor).getBackgroundColor(); final Color foreground = editor.getColoRSScheme().getColor(EditorColors.CARET_COLOR); toolbarComponent.setBackground(background); toolbarComponent.setBorder(new ColoredSideBorder(foreground,foreground,lineData == null || lineData.getStatus() == LineCoverage.NONE || mySubCoverageActive ? foreground : null,1)); toolbar.updateActionsImmediately(); return toolbarComponent; }
protected JComponent createActionsToolbar(final Editor editor,1)); toolbar.updateActionsImmediately(); return toolbarComponent; }
com.intellij.lang.cacheBuilder.DefaultWordsScanner的实例源码
@Nullable @Override public WordsScanner getWordsScanner() { /** * Creates a new instance of the words scanner. * * @param lexer the lexer used for breaking the text into tokens. * @param identifierTokenSet the set of token types which represent identifiers. * @param commentTokenSet the set of token types which represent comments. * @param literalTokenSet the set of token types which represent literals. * @param skipCodeContextTokenSet the set of token types which should not be considered as code context. */ DefaultWordsScanner wordsScanner = new DefaultWordsScanner(new MultiMarkdownLexer(),TokenSet.create(WIKI_LINK_REF,WIKI_LINK_TEXT),TokenSet.create(COMMENT),TokenSet.EMPTY,TokenSet.EMPTY) { @Override public int getVersion() { return super.getVersion() + 7; } }; return wordsScanner; }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new FrogLexer(),TokenSet.create(FrogTypes.FROG_WORD),FrogParserDeFinition.COMMENT_TOKENS,TokenSet.create( FrogTypes.FROG_NULL,FrogTypes.FROG_SIMPLE_STRING,FrogTypes.FROG_MULTILINE_STRING,FrogTypes.FROG_INTEGER,FrogTypes.FROG_LONG,FrogTypes.FROG_FLOAT,FrogTypes.FROG_DOUBLE,FrogTypes.FROG_TRUE,FrogTypes.FROG_FALSE,FrogTypes.FROG_BYTE_ARRAY )); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new TSLexerAdapter(),TokenSet.create(TSTypes.ID),TokenSet.create(TSTypes.COMMENT),TokenSet.EMPTY ); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new AppleScriptLexerAdapter(),TokenSet.create(AppleScriptTypes.IDENTIFIER),TokenSet.create(AppleScriptTypes.COMMENT),TokenSet.create(AppleScriptTypes.STRING_LIteraL)); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new SoyLexer(),TokenSet.create(SoyTypes.IDENTIFIER_WORD),TokenSet.create(SoyTypes.COMMENT_BLOCK),TokenSet.EMPTY); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new ImpexLexerAdapter(),orSet( create(ImpexTypes.MACRO_NAME_DECLaraTION),create(ImpexTypes.MACRO_DECLaraTION),create(ImpexTypes.MACRO_USAGE) ),create(ImpexTypes.COMMENT),TokenSet.ANY ); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new YAMLFlexLexer(),TokenSet.create(YAMLTokenTypes.SCALAR_KEY),TokenSet.create(YAMLTokenTypes.COMMENT),TokenSet.create(YAMLTokenTypes.SCALAR_TEXT,YAMLTokenTypes.SCALAR_DSTRING,YAMLTokenTypes.SCALAR_STRING)); }
@NotNull public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new LuaLexer(),LuaTokenTypes.IDENTIFIERS_SET,LuaTokenTypes.COMMENT_SET,LuaTokenTypes.LIteraLS_SET) {{ setMayHaveFileRefsInLiterals(true); }}; }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new SQFLexerAdapter(),SQFParserDeFinition.IDENTIFIERS,SQFParserDeFinition.COMMENTS,SQFParserDeFinition.NUMBER_LIteraLS ); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new ProtoLexerAdapter(),ProtoParserDeFinition.IDENTIFIER_TOKEN_SET,ProtoParserDeFinition.COMMENT_TOKEN_SET,ProtoParserDeFinition.LIteraL_TOKEN_SET); }
@Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new BuildLexer(LexerMode.SyntaxHighlighting),tokenSet(TokenKind.IDENTIFIER),tokenSet(TokenKind.COMMENT),tokenSet(TokenKind.STRING)); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(SchemaFlexAdapter.newInstance(),SchemaParserDeFinition.IDENTIFIERS,SchemaParserDeFinition.COMMENTS,SchemaParserDeFinition.LIteraLS); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new CndLexerAdapter(),// TokenSet.EMPTY,TokenSet.create(CndTypes.NAMESPACE_NAME,CndTypes.NODE_TYPE_NAME,CndTypes.PROPERTY_NAME),TokenSet.create(CndTypes.COMMENT),TokenSet.EMPTY ); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new KLexerAdapter(),TokenSet.create(KTypes.USER_ID),TokenSet.EMPTY); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new TheRLexer(),TokenSet.create(TheRElementTypes.THE_R_IDENTIFIER),TokenSet.create(TheRParserDeFinition.END_OF_LINE_COMMENT),TokenSet.create(TheRElementTypes.THE_R_STRING_LIteraL_EXPRESSION)); }
@NotNull public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new LuaLexer(),LuaTokenTypes.LIteraLS_SET) {{ setMayHaveFileRefsInLiterals(true); }}; }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new SmcLexerAdapter(),TokenSet.create(SmcTypes.TRANSITION),TokenSet.create(SmcTypes.LINE_COMMENT),TokenSet.EMPTY); }
@Nullable public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new jflexMergingLexer(),jflexElementTypes.IDENTIFIERS,jflexElementTypes.COMMENTS,jflexElementTypes.REGEXP_ScopE); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new XQueryLexer(),XQueryParserDeFinition.COMMENTS,XQueryParserDeFinition.STRINGS); }
com.intellij.lang.cacheBuilder.SimpleWordsScanner的实例源码
@Nullable @Override public WordsScanner getWordsScanner() { return new SimpleWordsScanner(); }
@Override @Nullable public WordsScanner getWordsScanner() { return new SimpleWordsScanner(); }
@Nullable public WordsScanner getWordsScanner() { return new SimpleWordsScanner(); }
com.intellij.lang.cacheBuilder.WordsScanner的实例源码
@Nullable @Override public WordsScanner getWordsScanner() { /** * Creates a new instance of the words scanner. * * @param lexer the lexer used for breaking the text into tokens. * @param identifierTokenSet the set of token types which represent identifiers. * @param commentTokenSet the set of token types which represent comments. * @param literalTokenSet the set of token types which represent literals. * @param skipCodeContextTokenSet the set of token types which should not be considered as code context. */ DefaultWordsScanner wordsScanner = new DefaultWordsScanner(new MultiMarkdownLexer(),TokenSet.create(WIKI_LINK_REF,WIKI_LINK_TEXT),TokenSet.create(COMMENT),TokenSet.EMPTY,TokenSet.EMPTY) { @Override public int getVersion() { return super.getVersion() + 7; } }; return wordsScanner; }
@Nullable @Override public WordsScanner getWordsScanner() { return null; // seems ok as JavaFindUsagesProvider does same thing // System.out.println("getWordsScanner()"); // final ANTLRv4Lexer lexer = new ANTLRv4Lexer(null); // // LexerATNSimulator sim = // ANTLRUtils.getLexerATNSimulator(lexer,ANTLRv4Lexer._ATN,lexer.getInterpreter().decisionToDFA,// lexer.getInterpreter().getSharedContextCache()); // lexer.setInterpreter(sim); // WordsScanner scanner = // new DefaultWordsScanner(new LexerAdaptor(lexer),// TokenSet.create(ANTLRv4TokenTypes.RULE_REF,// ANTLRv4TokenTypes.TOKEN_REF),// ANTLRv4TokenTypes.COMMENTS,// TokenSet.create(ANTLRv4TokenTypes.STRING_LIteraL) // ); // return scanner; }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new FrogLexer(),TokenSet.create(FrogTypes.FROG_WORD),FrogParserDeFinition.COMMENT_TOKENS,TokenSet.create( FrogTypes.FROG_NULL,FrogTypes.FROG_SIMPLE_STRING,FrogTypes.FROG_MULTILINE_STRING,FrogTypes.FROG_INTEGER,FrogTypes.FROG_LONG,FrogTypes.FROG_FLOAT,FrogTypes.FROG_DOUBLE,FrogTypes.FROG_TRUE,FrogTypes.FROG_FALSE,FrogTypes.FROG_BYTE_ARRAY )); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new TSLexerAdapter(),TokenSet.create(TSTypes.ID),TokenSet.create(TSTypes.COMMENT),TokenSet.EMPTY ); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new AppleScriptLexerAdapter(),TokenSet.create(AppleScriptTypes.IDENTIFIER),TokenSet.create(AppleScriptTypes.COMMENT),TokenSet.create(AppleScriptTypes.STRING_LIteraL)); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new SoyLexer(),TokenSet.create(SoyTypes.IDENTIFIER_WORD),TokenSet.create(SoyTypes.COMMENT_BLOCK),TokenSet.EMPTY); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new ImpexLexerAdapter(),orSet( create(ImpexTypes.MACRO_NAME_DECLaraTION),create(ImpexTypes.MACRO_DECLaraTION),create(ImpexTypes.MACRO_USAGE) ),create(ImpexTypes.COMMENT),TokenSet.ANY ); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new YAMLFlexLexer(),TokenSet.create(YAMLTokenTypes.SCALAR_KEY),TokenSet.create(YAMLTokenTypes.COMMENT),TokenSet.create(YAMLTokenTypes.SCALAR_TEXT,YAMLTokenTypes.SCALAR_DSTRING,YAMLTokenTypes.SCALAR_STRING)); }
@NotNull public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new LuaLexer(),LuaTokenTypes.IDENTIFIERS_SET,LuaTokenTypes.COMMENT_SET,LuaTokenTypes.LIteraLS_SET) {{ setMayHaveFileRefsInLiterals(true); }}; }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new SQFLexerAdapter(),SQFParserDeFinition.IDENTIFIERS,SQFParserDeFinition.COMMENTS,SQFParserDeFinition.NUMBER_LIteraLS ); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new ProtoLexerAdapter(),ProtoParserDeFinition.IDENTIFIER_TOKEN_SET,ProtoParserDeFinition.COMMENT_TOKEN_SET,ProtoParserDeFinition.LIteraL_TOKEN_SET); }
@Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new BuildLexer(LexerMode.SyntaxHighlighting),tokenSet(TokenKind.IDENTIFIER),tokenSet(TokenKind.COMMENT),tokenSet(TokenKind.STRING)); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(SchemaFlexAdapter.newInstance(),SchemaParserDeFinition.IDENTIFIERS,SchemaParserDeFinition.COMMENTS,SchemaParserDeFinition.LIteraLS); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner( new CndLexerAdapter(),// TokenSet.EMPTY,TokenSet.create(CndTypes.NAMESPACE_NAME,CndTypes.NODE_TYPE_NAME,CndTypes.PROPERTY_NAME),TokenSet.create(CndTypes.COMMENT),TokenSet.EMPTY ); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new KLexerAdapter(),TokenSet.create(KTypes.USER_ID),TokenSet.EMPTY); }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new TheRLexer(),TokenSet.create(TheRElementTypes.THE_R_IDENTIFIER),TokenSet.create(TheRParserDeFinition.END_OF_LINE_COMMENT),TokenSet.create(TheRElementTypes.THE_R_STRING_LIteraL_EXPRESSION)); }
@NotNull public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new LuaLexer(),LuaTokenTypes.LIteraLS_SET) {{ setMayHaveFileRefsInLiterals(true); }}; }
@Nullable @Override public WordsScanner getWordsScanner() { return new SimpleWordsScanner(); }
@Nullable @Override public WordsScanner getWordsScanner() { return WORDS_SCANNER; }
@Nullable @Override public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new SmcLexerAdapter(),TokenSet.create(SmcTypes.TRANSITION),TokenSet.create(SmcTypes.LINE_COMMENT),TokenSet.EMPTY); }
@Nullable @Override public WordsScanner getWordsScanner() { return null; }
@Nullable @Override public WordsScanner getWordsScanner() { return null; }
@Nullable @Override public WordsScanner getWordsScanner() { return new YamlWordScanner(); }
@Override public WordsScanner getWordsScanner() { return null; }
@Nullable public WordsScanner getWordsScanner() { return null; }
@Nullable @Override public WordsScanner getWordsScanner() { return new JsonWordScanner(); }
@Override public WordsScanner getWordsScanner() { return new PyWordsScanner(); }
@Override public WordsScanner getWordsScanner() { return null; }
public WordsScanner getWordsScanner() { return new PropertiesWordsScanner(); }
@Override @Nullable public WordsScanner getWordsScanner() { return new GroovyWordsScanner(); }
@Nullable public WordsScanner getWordsScanner() { return LanguageFindUsages.INSTANCE.forLanguage(XMLLanguage.INSTANCE).getWordsScanner(); }
@Override @Nullable public WordsScanner getWordsScanner() { return new SimpleWordsScanner(); }
@Nullable @Override public WordsScanner getWordsScanner() { return null; }
@Nullable @Override public WordsScanner getWordsScanner() { return null; }
@Nullable @Override public WordsScanner getWordsScanner() { return null; }
@Nullable public WordsScanner getWordsScanner() { return new DefaultWordsScanner(new jflexMergingLexer(),jflexElementTypes.IDENTIFIERS,jflexElementTypes.COMMENTS,jflexElementTypes.REGEXP_ScopE); }
@Nullable @Override public WordsScanner getWordsScanner() { return null; // null implies use SimpleWordScanner default }
@NotNull public WordsScanner getWordsScanner() { return DEFAULT_WORDS_SCANNER; }
@Nullable @Override public WordsScanner getWordsScanner() { return WORDS_SCANNER; }
com.intellij.openapi.editor.colors.CodeInsightColors的实例源码
@Override public void annotate(@NotNull final PsiElement element,@NotNull AnnotationHolder holder) { if (SmcTypes.ACTION_NAME.equals(element.getNode().getElementType())) { PsiElement parent = element.getParent(); if (parent == null || !(parent instanceof SmcAction)) { return; } SmcAction action = (SmcAction) parent; SmcFile containingFile = (SmcFile)action.getContainingFile(); String contextClassName = containingFile.getContextClassQName(); if (!SmcpsiUtil.isMethodInClass(contextClassName,action.getName(),action.getArgumentCount(),element.getProject())) { Annotation errorAnnotation = holder.createErrorAnnotation(element,getNotResolvedMessage(action.getFullName(),contextClassName)); errorAnnotation.setTextAttributes(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES); errorAnnotation.registerFix(new CreateMethodInContextClassFix(action.getName(),action.getArgumentCount())); } else if (SmcpsiUtil.isMethodInClassNotUnique(contextClassName,element.getProject())) { holder.createWarningAnnotation(element,getAmbiguityMessage(action.getFullName(),contextClassName)); } } }
@Override public void update(PresentationData data) { final PsiElement value = getPsiElement(); if (value == null || !value.isValid()) { setValue(null); } if (getPsiElement() == null) return; int flags = Iconable.ICON_FLAG_VISIBILITY; if (isMarkReadOnly()) { flags |= Iconable.ICON_FLAG_READ_STATUS; } LOG.assertTrue(value.isValid()); Icon icon = value.getIcon(flags); data.setIcon(icon); data.setPresentableText(myName); if (isDeprecated()) { data.setAttributesKey(CodeInsightColors.DEPRECATED_ATTRIBUTES); } updateImpl(data); for(ProjectViewNodeDecorator decorator: Extensions.getExtensions(ProjectViewNodeDecorator.EP_NAME,myProject)) { decorator.decorate(this,data); } }
/** * Returns the text attribute key used for highlighting the annotation. If not specified * explicitly,the key is determined automatically based on the problem highlight type and * the annotation severity. * * @return the text attribute key used for highlighting */ @NotNull public TextAttributesKey getTextAttributes() { if (myEnforcedAttributesKey != null) return myEnforcedAttributesKey; if (myHighlightType == ProblemHighlightType.GENERIC_ERROR_OR_WARNING) { if (mySeverity == HighlightSeverity.ERROR) return CodeInsightColors.ERRORS_ATTRIBUTES; if (mySeverity == HighlightSeverity.WARNING) return CodeInsightColors.WARNINGS_ATTRIBUTES; if (mySeverity == HighlightSeverity.WEAK_WARNING) return CodeInsightColors.WEAK_WARNING_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.GENERIC_ERROR) { return CodeInsightColors.ERRORS_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_DEPRECATED) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_UNUSED_SYMBOL) { return CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_UNKNowN_SYMBOL || myHighlightType == ProblemHighlightType.ERROR) { return CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES; } return HighlighterColors.NO_HIGHLIGHTING; }
private static void flashUsageScriptaculously(@NotNull final Usage usage) { if (!(usage instanceof UsageInfo2UsageAdapter)) { return; } UsageInfo2UsageAdapter usageInfo = (UsageInfo2UsageAdapter)usage; Editor editor = usageInfo.openTextEditor(true); if (editor == null) return; TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.BLINKING_HIGHLIGHTS_ATTRIBUTES); RangeBlinker rangeBlinker = new RangeBlinker(editor,attributes,6); List<Segment> segments = new ArrayList<Segment>(); CommonProcessors.CollectProcessor<Segment> processor = new CommonProcessors.CollectProcessor<Segment>(segments); usageInfo.processRangeMarkers(processor); rangeBlinker.resetMarkers(segments); rangeBlinker.startBlinking(); }
@NotNull public static LineMarkerInfo createMethodSeparatorLineMarker(@NotNull PsiElement startFrom,@NotNull EditorColorsManager colorsManager) { LineMarkerInfo info = new LineMarkerInfo<PsiElement>( startFrom,startFrom.getTextRange(),null,Pass.UPDATE_ALL,FunctionUtil.<Object,String>nullConstant(),GutterIconRenderer.Alignment.RIGHT ); EditorColoRSScheme scheme = colorsManager.getGlobalScheme(); info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEParaTORS_COLOR); info.separatorPlacement = SeparatorPlacement.TOP; return info; }
private static void addinspectionSeverityAttributes(List<AttributesDescriptor> descriptors) { descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unkNown.symbol"),CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES)); descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.deprecated.symbol"),CodeInsightColors.DEPRECATED_ATTRIBUTES)); descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unused.symbol"),CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES)); descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.error"),CodeInsightColors.ERRORS_ATTRIBUTES)); descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.warning"),CodeInsightColors.WARNINGS_ATTRIBUTES)); descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.weak.warning"),CodeInsightColors.WEAK_WARNING_ATTRIBUTES)); descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.problems"),CodeInsightColors.GENERIC_SERVER_ERROR_OR_WARNING)); descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.server.duplicate"),CodeInsightColors.DUPLICATE_FROM_SERVER)); for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) { for (HighlightInfoType highlightInfoType : provider.getSeveritiesHighlightInfoTypes()) { final TextAttributesKey attributesKey = highlightInfoType.getAttributesKey(); descriptors.add(new AttributesDescriptor(todisplayName(attributesKey),attributesKey)); } } }
@Override protected void updateImpl(PresentationData data) { PsiFile value = getValue(); data.setPresentableText(value.getName()); data.setIcon(value.getIcon(Iconable.ICON_FLAG_READ_STATUS)); VirtualFile file = getVirtualFile(); if (file != null && file.is(VFileProperty.SYMLINK)) { String target = file.getCanonicalPath(); if (target == null) { data.setAttributesKey(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES); data.setTooltip(CommonBundle.message("vfs.broken.link")); } else { data.setTooltip(FileUtil.toSystemDependentName(target)); } } }
@Override public void doApplyinformationToEditor() { HighlightInfo info = null; if (myRange != null) { TextAttributes attributes = new TextAttributes(null,myEditor.getColoRSScheme().getAttributes(CodeInsightColors.WEAK_WARNING_ATTRIBUTES) .getEffectColor(),Font.PLAIN); HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(HighlightInfoType.informatION).range(myRange); builder.textAttributes(attributes); builder.descriptionAndTooltip(SIGNATURE_SHOULD_BE_POSSIBLY_CHANGED); info = builder.createUnconditionally(); final ArrayList<IntentionAction> options = new ArrayList<IntentionAction>(); options.add(new dismissNewSignatureIntentionAction()); QuickFixAction.registerQuickFixAction(info,new ChangeSignatureDetectorAction(),options,null); } Collection<HighlightInfo> infos = info != null ? Collections.singletonList(info) : Collections.<HighlightInfo>emptyList(); UpdateHighlightersUtil.setHighlightersToEditor(myProject,myDocument,myFile.getTextLength(),infos,getColoRSScheme(),getId()); }
@Nullable public static Annotation createAnnotation(final DomElementProblemDescriptor problemDescriptor) { return createProblemDescriptors(problemDescriptor,new Function<Pair<TextRange,PsiElement>,Annotation>() { @Override public Annotation fun(final Pair<TextRange,PsiElement> s) { String text = problemDescriptor.getDescriptionTemplate(); if (StringUtil.isEmpty(text)) text = null; final HighlightSeverity severity = problemDescriptor.getHighlightSeverity(); TextRange range = s.first; if (text == null) range = TextRange.from(range.getStartOffset(),0); range = range.shiftRight(s.second.getTextRange().getStartOffset()); final Annotation annotation = createAnnotation(severity,range,text); if (problemDescriptor instanceof DomElementResolveProblemDescriptor) { annotation.setTextAttributes(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES); } for(LocalQuickFix fix:problemDescriptor.getFixes()) { if (fix instanceof IntentionAction) annotation.registerFix((IntentionAction)fix); } return annotation; } }); }
public static ItemPresentation getFieldPresentation(final PsiField psiField) { return new ColoredItemPresentation() { @Override public String getPresentableText() { return psiField.getName(); } @Override public TextAttributesKey getTextAttributesKey() { if (psiField.isDeprecated()) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } return null; } @Override public String getLocationString() { return getJavaSymbolContainerText(psiField); } @Override public Icon getIcon(boolean open) { return psiField.getIcon(Iconable.ICON_FLAG_VISIBILITY); } }; }
@Override public void update(PresentationData data) { final PsiElement value = getPsiElement(); if (value == null || !value.isValid()) { setValue(null); } if (getPsiElement() == null) return; int flags = Iconable.ICON_FLAG_VISIBILITY; if (isMarkReadOnly()) { flags |= Iconable.ICON_FLAG_READ_STATUS; } LOG.assertTrue(value.isValid()); Icon icon = value.getIcon(flags); data.setIcon(icon); data.setPresentableText(myName); if (isDeprecated()) { data.setAttributesKey(CodeInsightColors.DEPRECATED_ATTRIBUTES); } updateImpl(data); for(ProjectViewNodeDecorator decorator: Extensions.getExtensions(ProjectViewNodeDecorator.EP_NAME,data); } }
private static void flashUsageScriptaculously(@NotNull final Usage usage) { if (!(usage instanceof UsageInfo2UsageAdapter)) { return; } UsageInfo2UsageAdapter usageInfo = (UsageInfo2UsageAdapter)usage; Editor editor = usageInfo.openTextEditor(true); if (editor == null) return; TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.BLINKING_HIGHLIGHTS_ATTRIBUTES); RangeBlinker rangeBlinker = new RangeBlinker(editor,6); List<Segment> segments = new ArrayList<Segment>(); CommonProcessors.CollectProcessor<Segment> processor = new CommonProcessors.CollectProcessor<Segment>(segments); usageInfo.processRangeMarkers(processor); rangeBlinker.resetMarkers(segments); rangeBlinker.startBlinking(); }
/** * Returns the text attribute key used for highlighting the annotation. If not specified * explicitly,the key is determined automatically based on the problem highlight type and * the annotation severity. * * @return the text attribute key used for highlighting */ public TextAttributesKey getTextAttributes() { if (myEnforcedAttributesKey != null) return myEnforcedAttributesKey; if (myHighlightType == ProblemHighlightType.GENERIC_ERROR_OR_WARNING) { if (mySeverity == HighlightSeverity.ERROR) return CodeInsightColors.ERRORS_ATTRIBUTES; if (mySeverity == HighlightSeverity.WARNING) return CodeInsightColors.WARNINGS_ATTRIBUTES; if (mySeverity == HighlightSeverity.WEAK_WARNING) return CodeInsightColors.WEAK_WARNING_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.GENERIC_ERROR) { return CodeInsightColors.ERRORS_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_DEPRECATED) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_UNUSED_SYMBOL) { return CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_UNKNowN_SYMBOL || myHighlightType == ProblemHighlightType.ERROR) { return CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES; } return HighlighterColors.TEXT; }
@NotNull public static LineMarkerInfo createMethodSeparatorLineMarker(@NotNull PsiElement startFrom,GutterIconRenderer.Alignment.RIGHT ); EditorColoRSScheme scheme = colorsManager.getGlobalScheme(); info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEParaTORS_COLOR); info.separatorPlacement = SeparatorPlacement.TOP; return info; }
private static void addinspectionSeverityAttributes(List<AttributesDescriptor> descriptors) { descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unkNown.symbol"),CodeInsightColors.DUPLICATE_FROM_SERVER)); for (SeveritiesProvider provider : Extensions.getExtensions(SeveritiesProvider.EP_NAME)) { for (HighlightInfoType highlightInfoType : provider.getSeveritiesHighlightInfoTypes()) { final TextAttributesKey attributesKey = highlightInfoType.getAttributesKey(); descriptors.add(new AttributesDescriptor(attributesKey.myExternalName,attributesKey)); } } }
@Override protected void updateImpl(PresentationData data) { PsiFile value = getValue(); data.setPresentableText(value.getName()); data.setIcon(value.getIcon(Iconable.ICON_FLAG_READ_STATUS)); VirtualFile file = getVirtualFile(); if (file != null && file.is(VFileProperty.SYMLINK)) { String target = file.getCanonicalPath(); if (target == null) { data.setAttributesKey(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES); data.setTooltip(CommonBundle.message("vfs.broken.link")); } else { data.setTooltip(FileUtil.toSystemDependentName(target)); } } }
@Override public void doApplyinformationToEditor() { HighlightInfo info = null; if (myRange != null) { TextAttributes attributes = new TextAttributes(null,getId()); }
@Nullable public static Annotation createAnnotation(final DomElementProblemDescriptor problemDescriptor) { return createProblemDescriptors(problemDescriptor,Annotation>() { public Annotation fun(final Pair<TextRange,text); if (problemDescriptor instanceof DomElementResolveProblemDescriptor) { annotation.setTextAttributes(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES); } for(LocalQuickFix fix:problemDescriptor.getFixes()) { if (fix instanceof IntentionAction) annotation.registerFix((IntentionAction)fix); } return annotation; } }); }
@requiredReadAction @Nullable @Override public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) { if(myDaemonSettings.SHOW_METHOD_SEParaTORS) { if(element instanceof LuaDocComment) { LuaDocCommentOwner owner = ((LuaDocComment) element).getowner(); if(owner instanceof LuaFunctionDeFinition) { TextRange range = new TextRange(element.getTextOffset(),owner.getTextRange().getEndOffset()); LineMarkerInfo<PsiElement> info = new LineMarkerInfo<>(element,NullableFunction.NULL,GutterIconRenderer.Alignment.RIGHT); EditorColoRSScheme scheme = myColorsManager.getGlobalScheme(); info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEParaTORS_COLOR); info.separatorPlacement = SeparatorPlacement.TOP; return info; } } } return null; }
@Override @Nullable public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) { if (myDaemonSettings.SHOW_METHOD_SEParaTORS) { if (element instanceof DylanDeFinition) { LineMarkerInfo info = new LineMarkerInfo<PsiElement>(element,element.getTextRange(),GutterIconRenderer.Alignment.RIGHT); EditorColoRSScheme scheme = myColorsManager.getGlobalScheme(); info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEParaTORS_COLOR); info.separatorPlacement = SeparatorPlacement.BottOM; return info; } } return null; }
/** * Returns the text attribute key used for highlighting the annotation. If not specified * explicitly,the key is determined automatically based on the problem highlight type and * the annotation severity. * * @return the text attribute key used for highlighting */ @Nonnull public TextAttributesKey getTextAttributes() { if (myEnforcedAttributesKey != null) return myEnforcedAttributesKey; if (myHighlightType == ProblemHighlightType.GENERIC_ERROR_OR_WARNING) { if (mySeverity == HighlightSeverity.ERROR) return CodeInsightColors.ERRORS_ATTRIBUTES; if (mySeverity == HighlightSeverity.WARNING) return CodeInsightColors.WARNINGS_ATTRIBUTES; if (mySeverity == HighlightSeverity.WEAK_WARNING) return CodeInsightColors.WEAK_WARNING_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.GENERIC_ERROR) { return CodeInsightColors.ERRORS_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_DEPRECATED) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_UNUSED_SYMBOL) { return CodeInsightColors.NOT_USED_ELEMENT_ATTRIBUTES; } if (myHighlightType == ProblemHighlightType.LIKE_UNKNowN_SYMBOL || myHighlightType == ProblemHighlightType.ERROR) { return CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES; } return HighlighterColors.NO_HIGHLIGHTING; }
private static void flashUsageScriptaculously(@Nonnull final Usage usage) { if (!(usage instanceof UsageInfo2UsageAdapter)) { return; } UsageInfo2UsageAdapter usageInfo = (UsageInfo2UsageAdapter)usage; Editor editor = usageInfo.openTextEditor(true); if (editor == null) return; TextAttributes attributes = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.BLINKING_HIGHLIGHTS_ATTRIBUTES); RangeBlinker rangeBlinker = new RangeBlinker(editor,6); List<Segment> segments = new ArrayList<>(); Processor<Segment> processor = Processors.cancelableCollectProcessor(segments); usageInfo.processRangeMarkers(processor); rangeBlinker.resetMarkers(segments); rangeBlinker.startBlinking(); }
@Nonnull public static LineMarkerInfo createMethodSeparatorLineMarker(@Nonnull PsiElement startFrom,@Nonnull EditorColorsManager colorsManager) { LineMarkerInfo info = new LineMarkerInfo<>( startFrom,Pass.LINE_MARKERS,GutterIconRenderer.Alignment.RIGHT ); EditorColoRSScheme scheme = colorsManager.getGlobalScheme(); info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEParaTORS_COLOR); info.separatorPlacement = SeparatorPlacement.TOP; return info; }
private static void addinspectionSeverityAttributes(List<AttributesDescriptor> descriptors) { descriptors.add(new AttributesDescriptor(OptionsBundle.message("options.java.attribute.descriptor.unkNown.symbol"),attributesKey)); } } }
@Override protected void updateImpl(PresentationData data) { PsiFile value = getValue(); data.setPresentableText(value.getName()); data.setIcon(IconDescriptorUpdaters.getIcon(value,Iconable.ICON_FLAG_READ_STATUS)); VirtualFile file = getVirtualFile(); if (file != null && file.is(VFileProperty.SYMLINK)) { String target = file.getCanonicalPath(); if (target == null) { data.setAttributesKey(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES); data.setTooltip(CommonBundle.message("vfs.broken.link")); } else { data.setTooltip(FileUtil.toSystemDependentName(target)); } } }
@Override public void doApplyinformationToEditor() { HighlightInfo info = null; final InplaceChangeSignature currentRefactoring = InplaceChangeSignature.getCurrentRefactoring(myEditor); if (currentRefactoring != null) { final ChangeInfo changeInfo = currentRefactoring.getStableChange(); final PsiElement element = changeInfo.getmethod(); int offset = myEditor.getCaretModel().getoffset(); if (element == null || !element.isValid()) return; final TextRange elementTextRange = element.getTextRange(); if (elementTextRange == null || !elementTextRange.contains(offset)) return; final LanguageChangeSignatureDetector<ChangeInfo> detector = LanguageChangeSignatureDetectors.INSTANCE.forLanguage(changeInfo.getLanguage()); TextRange range = detector.getHighlightingRange(changeInfo); TextAttributes attributes = new TextAttributes(null,myEditor.getColoRSScheme().getAttributes(CodeInsightColors.WEAK_WARNING_ATTRIBUTES) .getEffectColor(),Font.PLAIN); HighlightInfo.Builder builder = HighlightInfo.newHighlightInfo(HighlightInfoType.informatION).range(range); builder.textAttributes(attributes); builder.descriptionAndTooltip(SIGNATURE_SHOULD_BE_POSSIBLY_CHANGED); info = builder.createUnconditionally(); QuickFixAction.registerQuickFixAction(info,new ApplyChangeSignatureAction(currentRefactoring.getinitialName())); } Collection<HighlightInfo> infos = info != null ? Collections.singletonList(info) : Collections.emptyList(); UpdateHighlightersUtil.setHighlightersToEditor(myProject,getId()); }
@Nullable public static Annotation createAnnotation(final DomElementProblemDescriptor problemDescriptor) { return createProblemDescriptors(problemDescriptor,text); if (problemDescriptor instanceof DomElementResolveProblemDescriptor) { annotation.setTextAttributes(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES); } for(LocalQuickFix fix:problemDescriptor.getFixes()) { if (fix instanceof IntentionAction) annotation.registerFix((IntentionAction)fix); } return annotation; } }); }
public static ItemPresentation getFieldPresentation(final PsiField psiField) { return new ColoredItemPresentation() { @Override public String getPresentableText() { return psiField.getName(); } @Override public TextAttributesKey getTextAttributesKey() { if (psiField.isDeprecated()) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } return null; } @Override public String getLocationString() { return getJavaSymbolContainerText(psiField); } @Override public Icon getIcon(boolean open) { return IconDescriptorUpdaters.getIcon(psiField,Iconable.ICON_FLAG_VISIBILITY); } }; }
@Override public void update(PresentationData data) { final PsiElement value = getPsiElement(); if (value == null || !value.isValid()) { setValue(null); } if (getPsiElement() == null) return; int flags = Iconable.ICON_FLAG_VISIBILITY; if (isMarkReadOnly()) { flags |= Iconable.ICON_FLAG_READ_STATUS; } LOG.assertTrue(value.isValid()); Icon icon = IconDescriptorUpdaters.getIcon(value,flags); data.setIcon(icon); data.setPresentableText(myName); if (isDeprecated()) { data.setAttributesKey(CodeInsightColors.DEPRECATED_ATTRIBUTES); } updateImpl(data); for(ProjectViewNodeDecorator decorator: Extensions.getExtensions(ProjectViewNodeDecorator.EP_NAME,data); } }
@Override public LineMarkerInfo getLineMarkerInfo(final PsiElement element) { if (element instanceof LuaReturnStatement && LuaApplicationSettings.getInstance().SHOW_TAIL_CALLS_IN_GUTTER) { LuaReturnStatement e = (LuaReturnStatement) element; if (e.isTailCall()) return new LineMarkerInfo<PsiElement>(element,LuaIcons.TAIL_RECURSION,tailCallTooltip,GutterIconRenderer.Alignment.LEFT); } if (myDaemonSettings.SHOW_METHOD_SEParaTORS) { if (element instanceof LuaDocComment) { LuaDocCommentOwner owner = ((LuaDocComment) element).getowner(); if (owner instanceof LuaFunctionDeFinition) { TextRange range = new TextRange(element.getTextOffset(),owner.getTextRange().getEndOffset()); LineMarkerInfo<PsiElement> info = new LineMarkerInfo<PsiElement>(element,GutterIconRenderer.Alignment.RIGHT); EditorColoRSScheme scheme = myColorsManager.getGlobalScheme(); info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEParaTORS_COLOR); info.separatorPlacement = SeparatorPlacement.TOP; return info; } } } return null; }
@Override public void annotate(@NotNull PsiElement element,@NotNull AnnotationHolder holder) { if (element instanceof SmcParameterType) { SmcParameterType type = (SmcParameterType) element; String name = type.getName(); PsiElement nameIdentifier = type.getNameIdentifier(); if (name == null || nameIdentifier == null) return; if (!SmcpsiUtil.isTypeAvailableFromSmc(type)) { Annotation errorAnnotation = holder.createErrorAnnotation(nameIdentifier,getMessage(name)); errorAnnotation.setTextAttributes(CodeInsightColors.WRONG_REFERENCES_ATTRIBUTES); } } }
public static Color errorColor() { TextAttributes attribute = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.ERRORS_ATTRIBUTES); Color color = JBColor.RED; if (attribute != null) { if (attribute.getForegroundColor() != null) { color = attribute.getForegroundColor(); } else if (attribute.getEffectColor() != null) { color = attribute.getEffectColor(); } else if (attribute.getErrorStripeColor() != null) { color = attribute.getErrorStripeColor(); } } return color; }
public static Color warningColor() { TextAttributes attribute = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.WARNINGS_ATTRIBUTES); Color color = JBColor.ORANGE; if (attribute != null) { if (attribute.getForegroundColor() != null) { color = attribute.getForegroundColor(); } else if (attribute.getEffectColor() != null) { color = attribute.getEffectColor(); } else if (attribute.getErrorStripeColor() != null) { color = attribute.getErrorStripeColor(); } } return color; }
@Override public ItemPresentation getPresentation(@NotNull final PsiClass psiClass) { return new ColoredItemPresentation() { @Override public String getPresentableText() { return ClasspresentationUtil.getNameForClass(psiClass,false); } @Override public String getLocationString() { PsiFile file = psiClass.getContainingFile(); if (file instanceof PsiClassOwner) { PsiClassOwner classOwner = (PsiClassOwner)file; String packageName = classOwner.getPackageName(); if (packageName.isEmpty()) return null; return "(" + packageName + ")"; } return null; } @Override public TextAttributesKey getTextAttributesKey() { try { if (psiClass.isDeprecated()) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } } catch (IndexNotReadyException ignore) { } return null; } @Override public Icon getIcon(boolean open) { return psiClass.getIcon(Iconable.ICON_FLAG_VISIBILITY | Iconable.ICON_FLAG_READ_STATUS); } }; }
@NotNull public static ColoredItemPresentation getmethodPresentation(@NotNull final PsiMethod psiMethod) { return new ColoredItemPresentation() { @Override public String getPresentableText() { return PsiFormatUtil.formatMethod( psiMethod,PsiSubstitutor.EMPTY,PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_ParaMETERS,PsiFormatUtilBase.SHOW_TYPE ); } @Override public TextAttributesKey getTextAttributesKey() { if (psiMethod.isDeprecated()) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } return null; } @Override public String getLocationString() { return getJavaSymbolContainerText(psiMethod); } @Override public Icon getIcon(boolean open) { return psiMethod.getIcon(Iconable.ICON_FLAG_VISIBILITY); } }; }
@NotNull public static ItemPresentation getFieldPresentation(@NotNull final PsiField psiField) { return new ColoredItemPresentation() { @Override public String getPresentableText() { return psiField.getName(); } @Override public TextAttributesKey getTextAttributesKey() { if (psiField.isDeprecated()) { return CodeInsightColors.DEPRECATED_ATTRIBUTES; } return null; } @Override public String getLocationString() { return getJavaSymbolContainerText(psiField); } @Override public Icon getIcon(boolean open) { return psiField.getIcon(Iconable.ICON_FLAG_VISIBILITY); } }; }
@NotNull private static Icon createErrorIcon() { return new SingleColorIcon(CodeInsightColors.ERRORS_ATTRIBUTES) { @Override public void paintIcon(Component c,Graphics g,int x,int y) { IconUtil.colorize(AllIcons.General.inspectionsError,getColor()).paintIcon(c,g,x,y); } }; }
@NotNull public static HighlightInfoType highlightTypeFromDescriptor(@NotNull ProblemDescriptor problemDescriptor,@NotNull HighlightSeverity severity,@NotNull SeverityRegistrar severityRegistrar) { final ProblemHighlightType highlightType = problemDescriptor.getHighlightType(); switch (highlightType) { case GENERIC_ERROR_OR_WARNING: return severityRegistrar.getHighlightInfoTypeBySeverity(severity); case LIKE_DEPRECATED: return new HighlightInfoType.HighlightInfoTypeImpl(severity,HighlightInfoType.DEPRECATED.getAttributesKey()); case LIKE_UNKNowN_SYMBOL: if (severity == HighlightSeverity.ERROR) { return new HighlightInfoType.HighlightInfoTypeImpl(severity,HighlightInfoType.WRONG_REF.getAttributesKey()); } if (severity == HighlightSeverity.WARNING) { return new HighlightInfoType.HighlightInfoTypeImpl(severity,CodeInsightColors.WEAK_WARNING_ATTRIBUTES); } return severityRegistrar.getHighlightInfoTypeBySeverity(severity); case LIKE_UNUSED_SYMBOL: return new HighlightInfoType.HighlightInfoTypeImpl(severity,HighlightInfoType.UNUSED_SYMBOL.getAttributesKey()); case INFO: return HighlightInfoType.INFO; case WEAK_WARNING: return HighlightInfoType.WEAK_WARNING; case ERROR: return HighlightInfoType.WRONG_REF; case GENERIC_ERROR: return HighlightInfoType.ERROR; case informatION: final TextAttributesKey attributes = ((ProblemDescriptorBase)problemDescriptor).getEnforcedTextAttributes(); if (attributes != null) { return new HighlightInfoType.HighlightInfoTypeImpl(HighlightSeverity.informatION,attributes); } return HighlightInfoType.informatION; } throw new RuntimeException("Cannot map " + highlightType); }
@NotNull private static TextAttributes getFollowedHyperlinkAttributes(@NotNull RangeHighlighter range) { HyperlinkInfoTextAttributes attrs = HYPERLINK.get(range); TextAttributes result = attrs != null ? attrs.getFollowedHyperlinkAttributes() : null; if (result == null) { result = EditorColorsManager.getInstance().getGlobalScheme().getAttributes(CodeInsightColors.FOLLOWED_HYPERLINK_ATTRIBUTES); } return result; }
@Override protected void postprocess(@NotNull PresentationData presentation) { if (hasProblemFileBeneath() ) { presentation.setAttributesKey(CodeInsightColors.ERRORS_ATTRIBUTES); } setForcedForeground(presentation); if (hasProblemFileBeneath() ) { presentation.setAttributesKey(CodeInsightColors.ERRORS_ATTRIBUTES); } }
关于com.intellij.ui.ColoredSideBorder的实例源码和源代码示例的问题就给大家分享到这里,感谢你花时间阅读本站内容,更多关于com.intellij.lang.cacheBuilder.DefaultWordsScanner的实例源码、com.intellij.lang.cacheBuilder.SimpleWordsScanner的实例源码、com.intellij.lang.cacheBuilder.WordsScanner的实例源码、com.intellij.openapi.editor.colors.CodeInsightColors的实例源码等相关知识的信息别忘了在本站进行查找喔。
本文标签: