本文整理汇总了Java中com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo类的典型用法代码示例。如果您正苦于以下问题:Java RelatedItemLineMarkerInfo类的具体用法?Java RelatedItemLineMarkerInfo怎么用?Java RelatedItemLineMarkerInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RelatedItemLineMarkerInfo类属于com.intellij.codeInsight.daemon包,在下文中一共展示了RelatedItemLineMarkerInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collectNavigationMarkers
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo; //导入依赖的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: match
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo; //导入依赖的package包/类
@Override
public boolean match(@NotNull LineMarkerInfo markerInfo) {
if(markerInfo.getLineMarkerTooltip() == null || !markerInfo.getLineMarkerTooltip().equals(toolTip)) {
return false;
}
if(!(markerInfo instanceof RelatedItemLineMarkerInfo)) {
return false;
}
for (Object o : ((RelatedItemLineMarkerInfo) markerInfo).createGotoRelatedItems()) {
if(o instanceof GotoRelatedItem && this.pattern.accepts(((GotoRelatedItem) o).getElement())) {
return true;
}
}
return false;
}
示例3: createTargetsWithGutterIcon
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo; //导入依赖的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.daemon.RelatedItemLineMarkerInfo; //导入依赖的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.daemon.RelatedItemLineMarkerInfo; //导入依赖的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.daemon.RelatedItemLineMarkerInfo; //导入依赖的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.daemon.RelatedItemLineMarkerInfo; //导入依赖的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.daemon.RelatedItemLineMarkerInfo; //导入依赖的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.daemon.RelatedItemLineMarkerInfo; //导入依赖的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.daemon.RelatedItemLineMarkerInfo; //导入依赖的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: addItemsForMarkers
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo; //导入依赖的package包/类
private static void addItemsForMarkers(List<RelatedItemLineMarkerInfo> markers,
List<GotoRelatedItem> result) {
Set<PsiFile> addedFiles = new HashSet<PsiFile>();
for (RelatedItemLineMarkerInfo<?> marker : markers) {
Collection<? extends GotoRelatedItem> items = marker.createGotoRelatedItems();
for (GotoRelatedItem item : items) {
PsiElement element = item.getElement();
if (element instanceof PsiFile) {
PsiFile file = (PsiFile)element;
if (addedFiles.contains(file)) {
continue;
}
}
if (element != null) {
ContainerUtil.addIfNotNull(element.getContainingFile(), addedFiles);
}
result.add(item);
}
}
}
示例12: getSingleLineMarker
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo; //导入依赖的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);
}
示例13: getSingleLineMarker
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo; //导入依赖的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 = ShopwarePluginIcons.SHOPWARE_LINEMARKER;
}
NavigationGutterIconBuilder<PsiElement> builder = NavigationGutterIconBuilder.create(icon).
setTargets(gotoRelatedItem.getElement());
String customName = gotoRelatedItem.getCustomName();
if(customName != null) {
builder.setTooltipText(customName);
}
return builder.createLineMarkerInfo(smartyFile);
}
示例14: collectNavigationMarkers
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo; //导入依赖的package包/类
@Override
protected void collectNavigationMarkers(@NotNull PsiElement element,
Collection<? super RelatedItemLineMarkerInfo> result) {
if (false && element instanceof PsiNamedElement) {
PsiNamedElement namedElement = (PsiNamedElement) element;
String value = namedElement.getName();
if (value != null) {
Project project = element.getProject();
final List<HaskellUtil.FoundDefinition> found =
HaskellUtil.findDefinitionNode(project, value, namedElement);
final List<PsiNamedElement> namedNodes = ContainerUtil.newArrayList();
for (HaskellUtil.FoundDefinition fd : found) {
namedNodes.add(fd.element);
}
if (namedNodes.size() > 0) {
NavigationGutterIconBuilder<PsiElement> builder =
NavigationGutterIconBuilder.create(HaskellIcons.FILE).
setTargets(namedNodes).
setTooltipText("Navigate to element definition");
result.add(builder.createLineMarkerInfo(element));
}
}
}
}
示例15: createLineMarkerInfo
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo; //导入依赖的package包/类
public RelatedItemLineMarkerInfo<PsiElement> createLineMarkerInfo(@NotNull PsiElement element) {
final MyNavigationGutterIconRenderer renderer = createGutterIconRenderer(element.getProject());
final String tooltip = renderer.getTooltipText();
NotNullLazyValue<Collection<? extends GotoRelatedItem>> gotoTargets = new NotNullLazyValue<Collection<? extends GotoRelatedItem>>() {
@NotNull
@Override
protected Collection<? extends GotoRelatedItem> compute() {
if (myGotoRelatedItemProvider != null) {
return ContainerUtil.concat(myTargets.getValue(), myGotoRelatedItemProvider);
}
return Collections.emptyList();
}
};
return new RelatedItemLineMarkerInfo<PsiElement>(element, element.getTextRange(), renderer.getIcon(), Pass.UPDATE_OVERRIDEN_MARKERS,
tooltip == null ? null : new ConstantFunction<PsiElement, String>(tooltip),
renderer.isNavigateAction() ? renderer : null, renderer.getAlignment(),
gotoTargets);
}