本文整理汇总了Java中com.intellij.codeInsight.navigation.NavigationGutterIconBuilder.create方法的典型用法代码示例。如果您正苦于以下问题:Java NavigationGutterIconBuilder.create方法的具体用法?Java NavigationGutterIconBuilder.create怎么用?Java NavigationGutterIconBuilder.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.codeInsight.navigation.NavigationGutterIconBuilder
的用法示例。
在下文中一共展示了NavigationGutterIconBuilder.create方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: annotateDependencyUsages
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入方法依赖的package包/类
private static void annotateDependencyUsages(@NotNull MavenDomDependency dependency, AnnotationHolder holder) {
final XmlTag tag = dependency.getXmlTag();
if (tag == null) return;
final Set<MavenDomDependency> children = MavenDomProjectProcessorUtils.searchDependencyUsages(dependency);
if (children.size() > 0) {
final NavigationGutterIconBuilder<MavenDomDependency> iconBuilder =
NavigationGutterIconBuilder.create(AllIcons.General.OverridenMethod, DependencyConverter.INSTANCE);
iconBuilder.
setTargets(children).
setPopupTitle(MavenDomBundle.message("navigate.parent.dependency.title")).
setCellRenderer(MyListCellRenderer.INSTANCE).
setTooltipText(MavenDomBundle.message("overriding.dependency.title")).
install(holder, dependency.getXmlTag());
}
}
示例2: annotateMavenDomPlugin
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入方法依赖的package包/类
private static void annotateMavenDomPlugin(@NotNull MavenDomPlugin plugin, @NotNull AnnotationHolder holder) {
XmlTag xmlTag = plugin.getArtifactId().getXmlTag();
if (xmlTag == null) return;
DomElement plugins = plugin.getParent();
if (plugins == null) return;
DomElement parent = plugins.getParent();
if (parent instanceof MavenDomPluginManagement) {
annotateMavenDomPluginInManagement(plugin, holder);
return;
}
MavenDomPlugin managingPlugin = MavenDomProjectProcessorUtils.searchManagingPlugin(plugin);
if (managingPlugin != null) {
NavigationGutterIconBuilder<MavenDomPlugin> iconBuilder =
NavigationGutterIconBuilder.create(AllIcons.General.OverridingMethod, PluginConverter.INSTANCE);
iconBuilder.
setTargets(Collections.singletonList(managingPlugin)).
setTooltipText(MavenDomBundle.message("overriden.plugin.title")).
install(holder, xmlTag);
}
}
示例3: annotateMavenDomPluginInManagement
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入方法依赖的package包/类
private static void annotateMavenDomPluginInManagement(@NotNull MavenDomPlugin plugin, @NotNull AnnotationHolder holder) {
XmlTag xmlTag = plugin.getArtifactId().getXmlTag();
if (xmlTag == null) return;
Collection<MavenDomPlugin> children = MavenDomProjectProcessorUtils.searchManagedPluginUsages(plugin);
if (children.size() > 0) {
NavigationGutterIconBuilder<MavenDomPlugin> iconBuilder =
NavigationGutterIconBuilder.create(AllIcons.General.OverridenMethod, PluginConverter.INSTANCE);
iconBuilder.
setTargets(children).
setPopupTitle(MavenDomBundle.message("navigate.parent.plugin.title")).
setCellRenderer(MyListCellRenderer.INSTANCE).
setTooltipText(MavenDomBundle.message("overriding.plugin.title")).
install(holder, xmlTag);
}
}
示例4: annotateManagedDependency
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入方法依赖的package包/类
private static void annotateManagedDependency(MavenDomDependency dependency, AnnotationHolder holder) {
final XmlTag tag = dependency.getXmlTag();
if (tag == null) return;
MavenDomDependency managingDependency = getManagingDependency(dependency);
if (managingDependency != null) {
final NavigationGutterIconBuilder<MavenDomDependency> iconBuilder =
NavigationGutterIconBuilder.create(AllIcons.General.OverridingMethod, DependencyConverter.INSTANCE);
iconBuilder.
setTargets(managingDependency).
setTooltipText(generateTooltip(managingDependency)).
install(holder, tag);
}
}
示例5: collectNavigationMarkers
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入方法依赖的package包/类
@Override
protected void collectNavigationMarkers(
@NotNull PsiElement element,
Collection<? super RelatedItemLineMarkerInfo> result
) {
ASTNode node = element.getNode();
if (node == null) {
return;
}
IElementType elementType = node.getElementType();
PsiElement parent = element.getParent();
boolean isPhpClassMethod = (elementType == PhpTokenTypes.IDENTIFIER) && parent instanceof Method;
boolean isPhpClass = (elementType == PhpTokenTypes.IDENTIFIER) && parent instanceof PhpClass;
boolean isPhpClassField = (elementType == PhpTokenTypes.VARIABLE) && parent instanceof Field;
if (isPhpClass || isPhpClassMethod || isPhpClassField) {
PhpNamedElement classMember = PsiTreeUtil.getParentOfType(element, PhpNamedElement.class);
List<PhpNamedElement> matchedAdvices = PointcutAdvisor.getMatchedAdvices(classMember);
if (matchedAdvices.size() > 0) {
NavigationGutterIconBuilder<PsiElement> builder = null;
builder = NavigationGutterIconBuilder.create(GoAopIcons.ADVISING_ELEMENT);
if (matchedAdvices.size() > 1) {
builder.setTooltipText("Navigate to AOP advices");
} else {
builder.setTooltipText("Advised by '" + matchedAdvices.get(0).getFQN() + "'");
}
builder.setTargets(matchedAdvices);
result.add(builder.createLineMarkerInfo(element));
}
}
}
示例6: collectNavigationMarkers
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入方法依赖的package包/类
@Override
protected void collectNavigationMarkers(
@NotNull PsiElement element,
Collection<? super RelatedItemLineMarkerInfo> result
) {
ASTNode node = element.getNode();
if (node == null) {
return;
}
IElementType elementType = node.getElementType();
PsiElement parent = element.getParent();
boolean isPhpClassMethod = (elementType == PhpTokenTypes.IDENTIFIER) && parent instanceof Method;
boolean isPhpClassField = (elementType == PhpTokenTypes.VARIABLE) && parent instanceof Field;
if (!isPhpClassMethod && !isPhpClassField) {
return;
}
boolean isParentAspect = PluginUtil.isAspect(((PhpClassMember) parent).getContainingClass());
if (!isParentAspect) {
return;
}
PhpNamedElement aspectMember = PsiTreeUtil.getParentOfType(element, PhpNamedElement.class);
List<PhpNamedElement> matchedElements = PointcutAdvisor.getMatchedElements(aspectMember);
if (matchedElements != null && matchedElements.size() > 0) {
NavigationGutterIconBuilder<PsiElement> builder;
builder = NavigationGutterIconBuilder.create(GoAopIcons.ADVISED_ELEMENT);
if (matchedElements.size() > 1) {
builder.setTooltipText("Navigate to advised elements");
} else {
builder.setTooltipText("Advising '" + matchedElements.get(0).getFQN() + "'");
}
builder.setTargets(matchedElements);
result.add(builder.createLineMarkerInfo(element));
}
}
示例7: annotateManagedDependency
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入方法依赖的package包/类
private static void annotateManagedDependency(MavenDomDependency dependency, AnnotationHolder holder) {
final XmlTag tag = dependency.getXmlTag();
if (tag == null) return;
final List<MavenDomDependency> children = getManagingDependencies(dependency);
if (children.size() > 0) {
final NavigationGutterIconBuilder<MavenDomDependency> iconBuilder =
NavigationGutterIconBuilder.create(AllIcons.General.OverridingMethod, DependencyConverter.INSTANCE);
iconBuilder.
setTargets(children).
setTooltipText(MavenDomBundle.message("overriden.dependency.title")).
install(holder, tag);
}
}