• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java GotoClassModel2类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.ide.util.gotoByName.GotoClassModel2的典型用法代码示例。如果您正苦于以下问题:Java GotoClassModel2类的具体用法?Java GotoClassModel2怎么用?Java GotoClassModel2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GotoClassModel2类属于com.intellij.ide.util.gotoByName包,在下文中一共展示了GotoClassModel2类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getPsiElementsFromClassesNames

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
/**
 * useful for go to declaration using only the class name
 *
 * @param classes
 * @param project
 * @return
 */
@NotNull
public static List<PsiElement> getPsiElementsFromClassesNames(List<String> classes, Project project) {
    List<PsiElement> psiElements = new ArrayList<PsiElement>();
    if (classes != null && project != null) {
        GotoClassModel2 model = new GotoClassModel2(project);
        for (String className : classes) {
            Object[] elements = model.getElementsByName(className, true, className);
            if (elements != null && elements.length > 0) {
                for (Object element : elements) {
                    if (element instanceof PsiElement) {
                        psiElements.add((PsiElement) element);

                    }
                }
            }
        }

    }
    return psiElements;
}
 
开发者ID:cmazx,项目名称:yiistorm,代码行数:28,代码来源:PsiPhpHelper.java


示例2: testGoToMessage

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public void testGoToMessage() throws Exception {
    ProtoPsiFileRoot file = addProto("test.proto", String.join("\n",
            "package navigation;",
            "message MyProtobufMessage {}"));
    ProtoType message = findType(file, "navigation.MyProtobufMessage");
    List<Object> elements = getPopupElements(new GotoClassModel2(getProject()), "MyProto", false);
    Assert.assertEquals(1, elements.size());
    Assert.assertSame(message, elements.get(0));
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:10,代码来源:GoToClassTest.java


示例3: testGoToNestedMessage

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public void testGoToNestedMessage() throws Exception {
    ProtoPsiFileRoot file = addProto("test.proto", String.join("\n",
            "package navigation;",
            "message MyProtobufMessage {",
            "enum MyProtobufNestedMessage {}",
            "}"));
    ProtoType message = findType(file, "navigation.MyProtobufMessage.MyProtobufNestedMessage");
    List<Object> elements = getPopupElements(new GotoClassModel2(getProject()), "MyProtoNes", false);
    Assert.assertEquals(1, elements.size());
    Assert.assertSame(message, elements.get(0));
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:12,代码来源:GoToClassTest.java


示例4: testGoToEnum

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public void testGoToEnum() throws Exception {
    ProtoPsiFileRoot file = addProto("test.proto", String.join("\n",
            "package navigation;",
            "enum MyProtobufEnum {}"));
    ProtoType anEnum = findType(file, "navigation.MyProtobufEnum");
    List<Object> elements = getPopupElements(new GotoClassModel2(getProject()), "MyProto", false);
    Assert.assertEquals(1, elements.size());
    Assert.assertSame(anEnum, elements.get(0));
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:10,代码来源:GoToClassTest.java


示例5: testGoToNestedEnum

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public void testGoToNestedEnum() throws Exception {
    ProtoPsiFileRoot file = addProto("test.proto", String.join("\n",
            "package navigation;",
            "message MyProtobufMessage {",
            "enum MyProtobufNestedEnum {}",
            "}"));
    ProtoType anEnum = findType(file, "navigation.MyProtobufMessage.MyProtobufNestedEnum");
    List<Object> elements = getPopupElements(new GotoClassModel2(getProject()), "MyProtoNes", false);
    Assert.assertEquals(1, elements.size());
    Assert.assertSame(anEnum, elements.get(0));
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:12,代码来源:GoToClassTest.java


示例6: testGoToService

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public void testGoToService() throws Exception {
    ProtoPsiFileRoot file = addProto("test.proto", String.join("\n",
            "package navigation;",
            "service MyProtobufService {}"));
    ProtoType service = findType(file, "navigation.MyProtobufService");
    List<Object> elements = getPopupElements(new GotoClassModel2(getProject()), "MyProto", false);
    Assert.assertEquals(1, elements.size());
    Assert.assertSame(service, elements.get(0));
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:10,代码来源:GoToClassTest.java


示例7: testMultipleElements

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public void testMultipleElements() throws Exception {
    addProto("test.proto", String.join("\n",
            "package navigation;",
            "message MyProtobufMessage {}",
            "enum MyProtobufEnum {}",
            "service MyProtobufService {}"
    ));
    List<Object> elements = getPopupElements(new GotoClassModel2(getProject()), "MyProto", false);
    Assert.assertEquals(3, elements.size());
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:11,代码来源:GoToClassTest.java


示例8: testGoToMessage_inCustomIncludePath

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public void testGoToMessage_inCustomIncludePath() throws Exception {
    File includePathRoot = tempDir;
    ProtobufSettings settings = getProject().getComponent(ProtobufSettings.class);
    settings.setIncludePaths(Collections.singletonList(includePathRoot.getAbsolutePath()));
    File proto = new File(tempDir.getPath() + "/test.proto");
    Writer writer = new BufferedWriter(new FileWriter(proto));
    writer.write("message MessageInCustomPath {}");
    writer.close();

    List<Object> elements = getPopupElements(new GotoClassModel2(getProject()), "MeInCus", false);
    Assert.assertEquals(1, elements.size());
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:13,代码来源:GoToClassTest.java


示例9: DirectoryChooser

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public DirectoryChooser(@NotNull Project project, @NotNull DirectoryChooserView view){
  super(project, true);
  myView = view;
  final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
  myFilterExisting = propertiesComponent.isTrueValue(FILTER_NON_EXISTING);
  myTabbedPaneWrapper = new TabbedPaneWrapper(getDisposable());
  myChooseByNamePanel = new ChooseByNamePanel(project, new GotoClassModel2(project){
    @NotNull
    @Override
    public String[] getNames(boolean checkBoxState) {
      return super.getNames(false);
    }
  }, "", false, null) {
    @Override
    protected void showTextFieldPanel() {
    }

    @Override
    protected void close(boolean isOk) {
      super.close(isOk);
      if (isOk) {
        final List<Object> elements = getChosenElements();
        if (elements != null && elements.size() > 0) {
          myActionListener.elementChosen(elements.get(0));
        }
        doOKAction();
      }
      else {
        doCancelAction();
      }
    }
  };
  Disposer.register(myDisposable, myChooseByNamePanel);
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:DirectoryChooser.java


示例10: DirectoryChooser

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public DirectoryChooser(@NotNull Project project, @NotNull DirectoryChooserView view){
  super(project, true);
  myView = view;
  final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
  myFilterExisting = propertiesComponent.isValueSet(FILTER_NON_EXISTING) && propertiesComponent.isTrueValue(FILTER_NON_EXISTING);
  myTabbedPaneWrapper = new TabbedPaneWrapper(getDisposable());
  myChooseByNamePanel = new ChooseByNamePanel(project, new GotoClassModel2(project){
    @NotNull
    @Override
    public String[] getNames(boolean checkBoxState) {
      return super.getNames(false);
    }
  }, "", false, null) {
    @Override
    protected void showTextFieldPanel() {
    }

    @Override
    protected void close(boolean isOk) {
      super.close(isOk);
      if (isOk) {
        final List<Object> elements = getChosenElements();
        if (elements != null && elements.size() > 0) {
          myActionListener.elementChosen(elements.get(0));
        }
        doOKAction();
      }
      else {
        doCancelAction();
      }
    }
  };
  Disposer.register(myDisposable, myChooseByNamePanel);
  init();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:DirectoryChooser.java


示例11: searchClasses

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public static ArrayList<String> searchClasses(String regex, Project project) {
    GotoClassModel2 model = new GotoClassModel2(project);
    Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);
    ArrayList classesNamesFounded = new ArrayList<String>();
    String[] models = model.getNames(true);
    for (String clazz : models) {

        if (p.matcher(clazz).find()) {
            classesNamesFounded.add(clazz);
        }
    }
    return classesNamesFounded;
}
 
开发者ID:cmazx,项目名称:yiistorm,代码行数:14,代码来源:CommonHelper.java


示例12: DirectoryChooser

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
public DirectoryChooser(@Nonnull Project project, @Nonnull DirectoryChooserView view){
  super(project, true);
  myView = view;
  final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
  myFilterExisting = propertiesComponent.isValueSet(FILTER_NON_EXISTING) && propertiesComponent.isTrueValue(FILTER_NON_EXISTING);
  myTabbedPaneWrapper = new TabbedPaneWrapper(getDisposable());
  myChooseByNamePanel = new ChooseByNamePanel(project, new GotoClassModel2(project){
    @Nonnull
    @Override
    public String[] getNames(boolean checkBoxState) {
      return super.getNames(false);
    }
  }, "", false, null) {
    @Override
    protected void showTextFieldPanel() {
    }

    @Override
    protected void close(boolean isOk) {
      super.close(isOk);
      if (isOk) {
        final List<Object> elements = getChosenElements();
        if (elements != null && elements.size() > 0) {
          myActionListener.elementChosen(elements.get(0));
        }
        doOKAction();
      }
      else {
        doCancelAction();
      }
    }
  };
  Disposer.register(myDisposable, myChooseByNamePanel);
  init();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:36,代码来源:DirectoryChooser.java


示例13: createModel

import com.intellij.ide.util.gotoByName.GotoClassModel2; //导入依赖的package包/类
@Override
protected GotoClassModel2 createModel(@NotNull Project project) {
  GotoClassModel2 model = super.createModel(project);
  model.setFilterItems(Collections.singleton(SchemaLanguage.INSTANCE));
  return model;
}
 
开发者ID:SumoLogic,项目名称:epigraph,代码行数:7,代码来源:SchemaDiagramAddElementAction.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FeatureIndexManager类代码示例发布时间:2022-05-22
下一篇:
Java ClosableIterator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap