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


Java Pass.UPDATE_ALL属性代码示例

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


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

示例1: createIconLineMarker

@Nullable
private static LineMarkerInfo<PsiElement> createIconLineMarker(PsiType type,
                                                               @Nullable PsiExpression initializer,
                                                               PsiElement bindingElement) {
  if (initializer == null) return null;

  final Project project = initializer.getProject();

  final VirtualFile file = ProjectIconsAccessor.getInstance(project).resolveIconFile(type, initializer);
  if (file == null) return null;

  final Icon icon = ProjectIconsAccessor.getInstance(project).getIcon(file);
  if (icon == null) return null;

  final GutterIconNavigationHandler<PsiElement> navHandler = new GutterIconNavigationHandler<PsiElement>() {
    @Override
    public void navigate(MouseEvent e, PsiElement elt) {
      FileEditorManager.getInstance(project).openFile(file, true);
    }
  };

  return new LineMarkerInfo<PsiElement>(bindingElement, bindingElement.getTextRange(), icon,
                                        Pass.UPDATE_ALL, null, navHandler,
                                        GutterIconRenderer.Alignment.LEFT);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:IconLineMarkerProvider.java

示例2: createMethodSeparatorLineMarker

@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(),
    null, 
    GutterIconRenderer.Alignment.RIGHT
  );
  EditorColorsScheme scheme = colorsManager.getGlobalScheme();
  info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEPARATORS_COLOR);
  info.separatorPlacement = SeparatorPlacement.TOP;
  return info;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:LineMarkersPass.java

示例3: getMethodMarker

@Nullable
private static LineMarkerInfo<PsiElement> getMethodMarker(final PsiElement element, final PyFunction function) {
  if (PyNames.INIT.equals(function.getName())) {
    return null;
  }
  final TypeEvalContext context = TypeEvalContext.codeAnalysis(element.getProject(), null);
  final PsiElement superMethod = PySuperMethodsSearch.search(function, context).findFirst();
  if (superMethod != null) {
    PyClass superClass = null;
    if (superMethod instanceof PyFunction) {
      superClass = ((PyFunction)superMethod).getContainingClass();
    }
    // TODO: show "implementing" instead of "overriding" icon for Python implementations of Java interface methods
    return new LineMarkerInfo<PsiElement>(element, element.getTextRange().getStartOffset(), AllIcons.Gutter.OverridingMethod,
                                          Pass.UPDATE_ALL,
                                          superClass == null ? null : new TooltipProvider("Overrides method in " + superClass.getName()),
                                          ourSuperMethodNavigator);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:PyLineMarkerProvider.java

示例4: getAttributeMarker

@Nullable
private static LineMarkerInfo<PsiElement> getAttributeMarker(PyTargetExpression element) {
  final String name = element.getReferencedName();
  if (name == null) {
    return null;
  }
  PyClass containingClass = PsiTreeUtil.getParentOfType(element, PyClass.class);
  if (containingClass == null) return null;
  for (PyClass ancestor : containingClass
    .getAncestorClasses(TypeEvalContext.codeAnalysis(element.getProject(), element.getContainingFile()))) {
    final PyTargetExpression ancestorAttr = ancestor.findClassAttribute(name, false);
    if (ancestorAttr != null) {
      return new LineMarkerInfo<PsiElement>(element, element.getTextRange().getStartOffset(),
                                            AllIcons.Gutter.OverridingMethod, Pass.UPDATE_ALL,
                                            new TooltipProvider("Overrides attribute in " + ancestor.getName()),
                                            ourSuperAttributeNavigator);
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:PyLineMarkerProvider.java

示例5: doHighlighting

@NotNull
protected Collection<HighlightInfo> doHighlighting(final Boolean externalToolPass) {
  final Project project = myTestFixture.getProject();
  PsiDocumentManager.getInstance(project).commitAllDocuments();
  final Editor editor = myTestFixture.getEditor();

  int[] ignore = externalToolPass == null || externalToolPass ? new int[]{
    Pass.LINE_MARKERS,
    Pass.LOCAL_INSPECTIONS,
    Pass.POPUP_HINTS,
    Pass.UPDATE_ALL,
    Pass.UPDATE_FOLDING,
    Pass.UPDATE_OVERRIDEN_MARKERS,
    Pass.VISIBLE_LINE_MARKERS,
  } : new int[]{Pass.EXTERNAL_TOOLS};
  return CodeInsightTestFixtureImpl.instantiateAndRun(myTestFixture.getFile(), editor, ignore, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:HighlightingTestBase.java

示例6: getLineMarkerInfo

@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, range, null, Pass.UPDATE_ALL, NullableFunction.NULL, null, GutterIconRenderer.Alignment.RIGHT);
				EditorColorsScheme scheme = myColorsManager.getGlobalScheme();
				info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEPARATORS_COLOR);
				info.separatorPlacement = SeparatorPlacement.TOP;
				return info;
			}
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-lua,代码行数:24,代码来源:LuaMethodSeparatorMarkerProvider.java

示例7: getLineMarkerInfo

@Nullable
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
	final GutterIconNavigationHandler<PsiElement> navHandler =
		new GutterIconNavigationHandler<PsiElement>() {
			@Override
			public void navigate(MouseEvent e, PsiElement elt) {
				System.out.println("don't click on me");
			}
		};
	if ( element instanceof RuleSpecNode ) {
		return new LineMarkerInfo<PsiElement>(element, element.getTextRange(), Icons.FILE,
											  Pass.UPDATE_ALL, null, navHandler,
											  GutterIconRenderer.Alignment.LEFT);
	}
	return null;
}
 
开发者ID:antlr,项目名称:intellij-plugin-v4,代码行数:17,代码来源:ANTLRv4LineMarkerProvider.java

示例8: getLineMarkerInfo

@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(), null, Pass.UPDATE_ALL,
                                                           FunctionUtil.<Object, String>nullConstant(), null,
                                                           GutterIconRenderer.Alignment.RIGHT);
      EditorColorsScheme scheme = myColorsManager.getGlobalScheme();
      info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEPARATORS_COLOR);
      info.separatorPlacement = SeparatorPlacement.BOTTOM;
      return info;
    }
  }
  return null;
}
 
开发者ID:dylan-foundry,项目名称:DeftIDEA,代码行数:16,代码来源:DylanLineMarkerProvider.java

示例9: createIconLineMarker

@Nullable
private static LineMarkerInfo<PsiElement> createIconLineMarker(PsiType type, @Nullable PsiExpression initializer, PsiElement bindingElement)
{
	if(initializer == null)
	{
		return null;
	}

	final Project project = initializer.getProject();

	final VirtualFile file = ProjectIconsAccessor.getInstance(project).resolveIconFile(type, initializer);
	if(file == null)
	{
		return null;
	}

	final Icon icon = ProjectIconsAccessor.getInstance(project).getIcon(file, initializer);
	if(icon == null)
	{
		return null;
	}

	final GutterIconNavigationHandler<PsiElement> navHandler = (e, elt) -> FileEditorManager.getInstance(project).openFile(file, true);

	return new LineMarkerInfo<>(bindingElement, bindingElement.getTextRange(), icon, Pass.UPDATE_ALL, null, navHandler, GutterIconRenderer.Alignment.LEFT);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:IconLineMarkerProvider.java

示例10: getLineMarkerInfo

@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, element.getTextRange(),
                    LuaIcons.TAIL_RECURSION, Pass.UPDATE_ALL,
                    tailCallTooltip, null,
                    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, range, null, Pass.UPDATE_ALL,
                                NullableFunction.NULL, null, GutterIconRenderer.Alignment.RIGHT);
                EditorColorsScheme scheme = myColorsManager.getGlobalScheme();
                info.separatorColor = scheme.getColor(CodeInsightColors.METHOD_SEPARATORS_COLOR);
                info.separatorPlacement = SeparatorPlacement.TOP;
                return info;
            }
        }
    }

    return null;
}
 
开发者ID:internetisalie,项目名称:lua-for-idea,代码行数:31,代码来源:LuaLineMarkerProvider.java

示例11: getLineMarkerInfo

@Nullable
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull final PsiElement element) {
  PsiModifierListOwner owner = getAnnotationOwner(element);
  boolean includeSourceInferred = CodeInsightSettings.getInstance().SHOW_SOURCE_INFERRED_ANNOTATIONS;
  if (owner == null || findSignatureNonCodeAnnotations(owner, includeSourceInferred).isEmpty()) {
    return null;
  }

  return new LineMarkerInfo<PsiElement>(element, element.getTextRange().getStartOffset(),
                                        AllIcons.Gutter.ExtAnnotation,
                                        Pass.UPDATE_ALL,
                                        ourTooltipProvider, MyIconGutterHandler.INSTANCE,
                                        GutterIconRenderer.Alignment.RIGHT);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ExternalAnnotationsLineMarkerProvider.java

示例12: createLineMarkerInfo

private LineMarkerInfo createLineMarkerInfo(PsiElement element, Ref<String> envRef) {
    final Icon icon;
    final String tooltip;
    final String url;
    boolean configureGQL = false;
    if(JSGraphQLLanguageInjectionUtil.RELAY_ENVIRONMENT.equals(envRef.get())) {
        icon = JSGraphQLIcons.Logos.Relay;
        tooltip = "Relay GraphQL Template";
        url = "https://facebook.github.io/relay/docs/api-reference-relay-ql.html";
    } else if(JSGraphQLLanguageInjectionUtil.GRAPHQL_ENVIRONMENT.equals(envRef.get())) {
        icon = JSGraphQLIcons.Logos.GraphQL;
        tooltip = "GraphQL";
        url = "http://graphql.org/";
    } else if(JSGraphQLLanguageInjectionUtil.APOLLO_ENVIRONMENT.equals(envRef.get())) {
        icon = JSGraphQLIcons.Logos.Apollo;
        tooltip = "Apollo Client GraphQL Template";
        url = "http://docs.apollostack.com/apollo-client/core.html";
        configureGQL = true;
    } else if(JSGraphQLLanguageInjectionUtil.LOKKA_ENVIRONMENT.equals(envRef.get())) {
        icon = JSGraphQLIcons.Logos.Lokka;
        tooltip = "Lokka GraphQL Template";
        url = "https://github.com/kadirahq/lokka";
        configureGQL = true;
    } else {
        return null;
    }
    if(configureGQL && !JSGraphQLLanguageInjectionUtil.isGQLEnvironmentConfigured(element.getProject())) {
        EditorNotifications.getInstance(element.getProject()).updateNotifications(element.getContainingFile().getVirtualFile());
    }
    return new LineMarkerInfo<>(element, element.getTextRange(), icon, Pass.UPDATE_ALL, o -> tooltip, (e, elt) -> {
        BrowserUtil.browse(url);
    }, GutterIconRenderer.Alignment.CENTER);
}
 
开发者ID:jimkyndemeyer,项目名称:js-graphql-intellij-plugin,代码行数:33,代码来源:JSGraphQLLineMarkerProvider.java

示例13: getLineMarkerInfo

public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement expr) {
    //todo: add navigation support for guttericons and tooltips
    if (expr instanceof GLSLFunctionDefinitionImpl) {
        //todo: check if a prototype exists
        return new LineMarkerInfo<GLSLFunctionDefinitionImpl>((GLSLFunctionDefinitionImpl) expr, expr.getTextOffset(), implementing, Pass.UPDATE_ALL, null, null);
    } else if (expr instanceof GLSLFunctionDeclarationImpl) {
        //todo: check if it is implemented
        return new LineMarkerInfo<GLSLFunctionDeclarationImpl>((GLSLFunctionDeclarationImpl) expr, expr.getTextOffset(), implemented, Pass.UPDATE_ALL, null, null);
    }
    return null;
}
 
开发者ID:Darkyenus,项目名称:glsl4idea,代码行数:11,代码来源:GLSLLineMarkerProvider.java

示例14: getLineMarkerInfo

public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
  if (ApplicationManager.getApplication().isUnitTestMode()) {
    return null;
  }
  if (element instanceof PsiMethod) {
    final PsiMethod method = (PsiMethod)element;
    if (isTestMethod(method)) {
      return new LineMarkerInfo<PsiMethod>(
        method, method.getModifierList().getTextRange(), PlatformIcons.TEST_SOURCE_FOLDER, Pass.UPDATE_ALL, null, new TestDataNavigationHandler(),
        GutterIconRenderer.Alignment.LEFT);
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:TestDataLineMarkerProvider.java

示例15: getLineMarkerInfo

/**
 * Returns {@link LineMarkerInfo} with set {@link PlatformIcons#FOLDER_ICON} if entry points to the directory.
 *
 * @param element current element
 * @return <code>null</code> if entry is not a directory
 */
@Nullable
@Override
public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
    boolean isDirectory = element instanceof IgnoreEntryDirectory;
    if (!isDirectory && element instanceof IgnoreEntryFile) {
        IgnoreEntryFile entry = (IgnoreEntryFile) element;
        VirtualFile parent = element.getContainingFile().getVirtualFile().getParent();
        Project project = element.getProject();
        VirtualFile projectDir = project.getBaseDir();
        if (parent == null || projectDir == null || !Utils.isUnder(parent, projectDir)) {
            return null;
        }
        List<VirtualFile> files = Glob.findOne(parent, entry);
        for (VirtualFile file : files) {
            if (!file.isDirectory()) {
                return null;
            }
        }
        isDirectory = files.size() > 0;
    }

    if (isDirectory) {
        return new LineMarkerInfo<PsiElement>(element, element.getTextRange(), PlatformIcons.FOLDER_ICON,
                Pass.UPDATE_ALL, null, null, GutterIconRenderer.Alignment.CENTER);
    }
    return null;
}
 
开发者ID:hsz,项目名称:idea-gitignore,代码行数:33,代码来源:IgnoreDirectoryMarkerProvider.java


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