本文整理汇总了Java中com.intellij.codeInsight.navigation.NavigationGutterIconBuilder类的典型用法代码示例。如果您正苦于以下问题:Java NavigationGutterIconBuilder类的具体用法?Java NavigationGutterIconBuilder怎么用?Java NavigationGutterIconBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NavigationGutterIconBuilder类属于com.intellij.codeInsight.navigation包,在下文中一共展示了NavigationGutterIconBuilder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collectNavigationMarkers
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
@Override
protected void collectNavigationMarkers(@NotNull PsiElement element,
@NotNull Collection<? super RelatedItemLineMarkerInfo> result) {
if (element instanceof AppleScriptApplicationReference) {
PsiElement leafNode = PsiTreeUtil.firstChild(element);
if (leafNode == null) return;
AppleScriptProjectDictionaryService dictionaryService = ServiceManager.getService(element.getProject(),
AppleScriptProjectDictionaryService.class);
AppleScriptApplicationReference appRef = (AppleScriptApplicationReference) element;
String appName = appRef.getApplicationName();
if (dictionaryService == null || StringUtil.isEmpty(appName)) return;
ApplicationDictionary dictionary = dictionaryService.getDictionary(appName);
if (dictionary == null /*|| dictionary.getApplicationBundle() == null*/) return;
NavigationGutterIconBuilder<PsiElement> builder =
NavigationGutterIconBuilder.create(dictionary.getIcon(0)).
setTargets(dictionary).setTooltipText("Navigate to application dictionary file");
result.add(builder.createLineMarkerInfo(leafNode));
}
}
示例2: getRelatedFiles
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
@Nullable
private LineMarkerInfo getRelatedFiles(@NotNull PsiFile file, @NotNull String controllerName, @NotNull PsiElement element) {
if (!(element instanceof Method)) {
return null;
}
Method method = (Method)element;
if (!method.getAccess().isPublic()) {
return null;
}
String methodName = method.getName();
PsiDirectory appDir = PsiUtil.getAppDirectoryFromFile(file);
String templatePath = String.format("View/%s/%s.ctp", controllerName, methodName);
VirtualFile relativeFile = VfsUtil.findRelativeFile(appDir, templatePath);
if (relativeFile == null) {
return null;
}
PsiFile targetFile = PsiUtil.convertVirtualFileToPsiFile(method.getProject(), relativeFile);
if (targetFile == null) {
return null;
}
PsiElement targetElement = targetFile.getFirstChild();
NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(CakeIcons.LOGO).setTarget(targetElement);
return builder.createLineMarkerInfo(method);
}
示例3: createTargetsWithGutterIcon
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
private void createTargetsWithGutterIcon(
final Collection<? super RelatedItemLineMarkerInfo> result,
final PsiClass psiClass,
final Collection<XmlElement> list
) {
final NavigationGutterIconBuilder builder
= NavigationGutterIconBuilder.create(HybrisIcons.TYPE_SYSTEM).setTargets(list);
builder.setEmptyPopupText(HybrisI18NBundleUtils.message(
"hybris.gutter.navigate.no.matching.beans",
new Object[0]
));
builder.setPopupTitle(HybrisI18NBundleUtils.message(
"hybris.bean.class.navigate.choose.class.title",
new Object[0]
));
builder.setTooltipText(HybrisI18NBundleUtils.message(
"hybris.item.class.tooltip.navigate.declaration", new Object[0]
));
result.add(builder.createLineMarkerInfo(psiClass.getNameIdentifier()));
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:23,代码来源:HybrisItemLineMakerProvider.java
示例4: registerMethodLike
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
private void registerMethodLike(PsiMethod psiMethod,
PsiElement identifier,
Collection<? super RelatedItemLineMarkerInfo> result,
Class<? extends SmcMethodLikeElement> aClass,
Predicate<SmcMethodLikeElement> predicate,
Icon icon,
String toolTipPattern) {
PsiElement nameIdentifier = identifier != null ? identifier : psiMethod.getNameIdentifier();
if (nameIdentifier != null) {
final List<? extends SmcMethodLikeElement> methodLikeElements = SmcPsiUtil.findMethodLikeForMethod(psiMethod, aClass, predicate);
if (methodLikeElements != null && !methodLikeElements.isEmpty()) {
ItemPresentation presentation = psiMethod.getPresentation();
NavigationGutterIconBuilder<PsiElement> builder =
NavigationGutterIconBuilder.create(icon).
setTargets(methodLikeElements).
setTooltipText(MessageFormat.format(toolTipPattern,
presentation != null ? presentation.getPresentableText() : psiMethod.getName()));
result.add(builder.createLineMarkerInfo(nameIdentifier));
}
}
}
示例5: registerTransition
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
private void registerTransition(PsiMethod psiMethod,
PsiElement identifier,
Collection<? super RelatedItemLineMarkerInfo> result,
Predicate<SmcTransition> predicate,
Icon icon,
String toolTipPattern) {
PsiElement nameIdentifier = identifier != null ? identifier : psiMethod.getNameIdentifier();
if (nameIdentifier != null) {
final List<SmcTransition> transitions = SmcPsiUtil.findTransitionByMethod(psiMethod, predicate);
if (transitions != null && !transitions.isEmpty()) {
ItemPresentation presentation = psiMethod.getPresentation();
NavigationGutterIconBuilder<PsiElement> builder =
NavigationGutterIconBuilder.create(icon).
setTargets(transitions).
setTooltipText(MessageFormat.format(toolTipPattern,
presentation != null ? presentation.getPresentableText() : psiMethod.getName()));
result.add(builder.createLineMarkerInfo(nameIdentifier));
}
}
}
示例6: registerMarker
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
public void registerMarker(PsiElement element,
Collection<? super RelatedItemLineMarkerInfo> result,
Predicate<SmcFile> predicate,
Icon icon,
String messagePattern) {
PsiClass psiClass = (PsiClass) element;
PsiIdentifier psiName = psiClass.getNameIdentifier();
String name = psiClass.getQualifiedName();
if (name != null && psiName != null) {
final List<SmcFile> smcFiles = SmcPsiUtil.findSmcFile(psiClass.getProject(), predicate);
if (smcFiles != null && !smcFiles.isEmpty()) {
NavigationGutterIconBuilder<PsiElement> builder =
NavigationGutterIconBuilder.create(icon).
setTargets(smcFiles).
setTooltipText(MessageFormat.format(messagePattern, name));
result.add(builder.createLineMarkerInfo(psiName));
}
}
}
示例7: collectNavigationMarkers
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
@Override
protected void collectNavigationMarkers(@NotNull PsiElement element, Collection<? super RelatedItemLineMarkerInfo> result) {
if (element instanceof XmlTag) {
XmlTag tag = (XmlTag) element;
String name = tag.getName();
if(!CatberryConstants.SPECIAL_COMPONENT_NAMES.contains(name)) {
if(!name.startsWith(CatberryConstants.CATBERRY_COMPONENT_TAG_PREFIX))
return;
name = CatberryComponentUtils.normalizeName(name);
}
final Project project = element.getProject();
final PsiFile file = CatberryComponentUtils.findComponentTemplate(project, name);
if (file != null) {
NavigationGutterIconBuilder<PsiElement> builder =
NavigationGutterIconBuilder.create(AllIcons.General.OverridenMethod).setTarget(file).setTooltipText(
CatberryBundle.message("navigate.to.component"));
result.add(builder.createLineMarkerInfo(element));
}
}
}
示例8: collectSlowLineMarkers
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
@Override
public void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result) {
for (PsiElement el : elements) {
if (!(el instanceof FusionType)
|| !(el.getParent() instanceof FusionPrototypeSignature)
|| (((FusionPrototypeSignature) el.getParent()).isInheritedInDefinition())
|| (el.getParent().getParent().getParent() instanceof FusionPropertyDeletion)) {
continue;
}
FusionType type = (FusionType) el;
Collection<PsiElement> targets = ResolveEngine.getNodeTypeDefinitions(el.getProject(), type);
if (!targets.isEmpty()) {
RelatedItemLineMarkerInfo info = NavigationGutterIconBuilder
.create(NeosIcons.NODE_TYPE)
.setTargets(targets)
.setTooltipText("Go to node type definition")
.createLineMarkerInfo(el);
result.add(info);
}
}
}
示例9: collectSlowLineMarkers
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
@Override
public void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result) {
for (PsiElement el : elements) {
if (el instanceof Method && ((Method) el).getAccess().isPublic()) {
VirtualFile template = ResolveEngine.findTemplate((Method) el);
if (template != null) {
PsiFile target = PsiManager.getInstance(el.getProject()).findFile(template);
RelatedItemLineMarkerInfo info = NavigationGutterIconBuilder
.create(NeosIcons.NODE_TYPE)
.setTarget(target)
.setTooltipText("Go to template")
.createLineMarkerInfo(el);
result.add(info);
}
}
}
}
示例10: classNameMarker
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
private void classNameMarker(PhpClass currentClass, Collection<? super RelatedItemLineMarkerInfo> result, Project project) {
Collection<PhpClass> target;
String tooltip;
if (Utils.isClassAtoumTest(currentClass)) {
target = Utils.locateTestedClasses(project, currentClass);
tooltip = "Navigate to tested class";
} else {
target = Utils.locateTestClasses(project, currentClass);
tooltip = "Navigate to test";
}
if (target.size() == 0) {
return;
}
NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(Icons.ATOUM).
setTargets(target).
setTooltipText(tooltip);
result.add(builder.createLineMarkerInfo(currentClass));
}
示例11: 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());
}
}
示例12: 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);
}
}
示例13: 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);
}
}
示例14: getSingleLineMarker
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
public static RelatedItemLineMarkerInfo<PsiElement> getSingleLineMarker(SmartyFile smartyFile, Collection<LineMarkerInfo> lineMarkerInfos, GotoRelatedItem gotoRelatedItem) {
// hell: find any possible small icon
Icon icon = null;
if(gotoRelatedItem instanceof RelatedPopupGotoLineMarker.PopupGotoRelatedItem) {
icon = ((RelatedPopupGotoLineMarker.PopupGotoRelatedItem) gotoRelatedItem).getSmallIcon();
}
if(icon == null) {
icon = OxidPluginIcons.OXID_LINEMARKER;
}
NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(icon).
setTargets(gotoRelatedItem.getElement());
String customName = gotoRelatedItem.getCustomName();
if(customName != null) {
builder.setTooltipText(customName);
}
return builder.createLineMarkerInfo(smartyFile);
}
示例15: attachControllerAction
import com.intellij.codeInsight.navigation.NavigationGutterIconBuilder; //导入依赖的package包/类
private void attachControllerAction(PsiElement sourceElement, Collection<LineMarkerInfo> lineMarkerInfos) {
if(!ShopwareProjectComponent.isValidForProject(sourceElement)) {
return;
}
String text = PsiElementUtils.trimQuote(sourceElement.getText());
if(text.startsWith("{") && text.endsWith("}")) {
List<PsiElement> controllerTargets = ExtJsUtil.getControllerTargets(sourceElement, text);
if(controllerTargets.size() > 0) {
NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(ShopwarePluginIcons.SHOPWARE_LINEMARKER).
setTargets(controllerTargets).
setTooltipText("Navigate to action");
lineMarkerInfos.add(builder.createLineMarkerInfo(sourceElement));
}
}
}