本文整理汇总了Java中com.intellij.navigation.GotoRelatedProvider类的典型用法代码示例。如果您正苦于以下问题:Java GotoRelatedProvider类的具体用法?Java GotoRelatedProvider怎么用?Java GotoRelatedProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GotoRelatedProvider类属于com.intellij.navigation包,在下文中一共展示了GotoRelatedProvider类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: collectRelatedItems
import com.intellij.navigation.GotoRelatedProvider; //导入依赖的package包/类
@NotNull
public static List<GotoRelatedItem> collectRelatedItems(@NotNull PsiElement contextElement, @Nullable DataContext dataContext) {
Set<GotoRelatedItem> items = ContainerUtil.newLinkedHashSet();
for (GotoRelatedProvider provider : Extensions.getExtensions(GotoRelatedProvider.EP_NAME)) {
items.addAll(provider.getItems(contextElement));
if (dataContext != null) {
items.addAll(provider.getItems(dataContext));
}
}
GotoRelatedItem[] result = items.toArray(new GotoRelatedItem[items.size()]);
Arrays.sort(result, new Comparator<GotoRelatedItem>() {
@Override
public int compare(GotoRelatedItem i1, GotoRelatedItem i2) {
String o1 = i1.getGroup();
String o2 = i2.getGroup();
return StringUtil.isEmpty(o1) ? 1 : StringUtil.isEmpty(o2) ? -1 : o1.compareTo(o2);
}
});
return Arrays.asList(result);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:NavigationUtil.java
示例2: getItems
import com.intellij.navigation.GotoRelatedProvider; //导入依赖的package包/类
@NotNull
public static List<GotoRelatedItem> getItems(@NotNull PsiFile psiFile, @Nullable Editor editor, @Nullable DataContext dataContext) {
PsiElement contextElement = psiFile;
if (editor != null) {
PsiElement element = psiFile.findElementAt(editor.getCaretModel().getOffset());
if (element != null) {
contextElement = element;
}
}
Set<GotoRelatedItem> items = new LinkedHashSet<GotoRelatedItem>();
for (GotoRelatedProvider provider : Extensions.getExtensions(GotoRelatedProvider.EP_NAME)) {
items.addAll(provider.getItems(contextElement));
if (dataContext != null) {
items.addAll(provider.getItems(dataContext));
}
}
sortByGroupNames(items);
return new ArrayList<GotoRelatedItem>(items);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:GotoRelatedFileAction.java
示例3: collectRelatedItems
import com.intellij.navigation.GotoRelatedProvider; //导入依赖的package包/类
@Nonnull
public static List<GotoRelatedItem> collectRelatedItems(@Nonnull PsiElement contextElement, @Nullable DataContext dataContext) {
Set<GotoRelatedItem> items = ContainerUtil.newLinkedHashSet();
for (GotoRelatedProvider provider : Extensions.getExtensions(GotoRelatedProvider.EP_NAME)) {
items.addAll(provider.getItems(contextElement));
if (dataContext != null) {
items.addAll(provider.getItems(dataContext));
}
}
GotoRelatedItem[] result = items.toArray(new GotoRelatedItem[items.size()]);
Arrays.sort(result, (i1, i2) -> {
String o1 = i1.getGroup();
String o2 = i2.getGroup();
return StringUtil.isEmpty(o1) ? 1 : StringUtil.isEmpty(o2) ? -1 : o1.compareTo(o2);
});
return Arrays.asList(result);
}
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:NavigationUtil.java
示例4: getItems
import com.intellij.navigation.GotoRelatedProvider; //导入依赖的package包/类
@Nonnull
public static List<GotoRelatedItem> getItems(@Nonnull PsiFile psiFile, @Nullable Editor editor, @Nullable DataContext dataContext) {
PsiElement contextElement = psiFile;
if (editor != null) {
PsiElement element = psiFile.findElementAt(editor.getCaretModel().getOffset());
if (element != null) {
contextElement = element;
}
}
Set<GotoRelatedItem> items = new LinkedHashSet<GotoRelatedItem>();
for (GotoRelatedProvider provider : Extensions.getExtensions(GotoRelatedProvider.EP_NAME)) {
items.addAll(provider.getItems(contextElement));
if (dataContext != null) {
items.addAll(provider.getItems(dataContext));
}
}
sortByGroupNames(items);
return new ArrayList<GotoRelatedItem>(items);
}
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:GotoRelatedFileAction.java
示例5: initComponent
import com.intellij.navigation.GotoRelatedProvider; //导入依赖的package包/类
@Override
public void initComponent() {
ExtensionPoint<GotoRelatedProvider> ep =
Extensions.getRootArea().getExtensionPoint(GotoRelatedProvider.EP_NAME);
for (GotoRelatedProvider provider : ep.getExtensions()) {
if (provider.getClass().equals(OCSwitchToHeaderOrSourceRelatedProvider.class)) {
ep.unregisterExtension(provider);
}
}
}
开发者ID:bazelbuild,项目名称:intellij,代码行数:11,代码来源:DelegatingSwitchToHeaderOrSourceProvider.java
注:本文中的com.intellij.navigation.GotoRelatedProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论