当前位置: 首页>>代码示例>>Java>>正文


Java ClassBrowser类代码示例

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


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

示例1: ApplicationConfigurable

import com.intellij.execution.ui.ClassBrowser; //导入依赖的package包/类
public ApplicationConfigurable(final Project project) {
  myProject = project;
  myModuleSelector = new ConfigurationModuleSelector(project, myModule.getComponent());
  myCommonProgramParameters.setModuleContext(myModuleSelector.getModule());
  myModule.getComponent().addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      myCommonProgramParameters.setModuleContext(myModuleSelector.getModule());
    }
  });
  ClassBrowser.createApplicationClassBrowser(project, myModuleSelector).setField(getMainClassField());
  myVersionDetector = new JreVersionDetector();

  myAnchor = UIUtil.mergeComponentsWithAnchor(myMainClass, myCommonProgramParameters, myAlternativeJREPanel, myModule);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:ApplicationConfigurable.java

示例2: createUIComponents

import com.intellij.execution.ui.ClassBrowser; //导入依赖的package包/类
private void createUIComponents() {
  myPackage = new LabeledComponent<EditorTextFieldWithBrowseButton>();
  myPackage.setComponent(new EditorTextFieldWithBrowseButton(myProject, false));

  myClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
  final TestClassBrowser classBrowser = new TestClassBrowser(myProject);
  myClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, new JavaCodeFragment.VisibilityChecker() {
    @Override
    public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
      try {
        if (declaration instanceof PsiClass && classBrowser.getFilter().isAccepted(((PsiClass)declaration))) {
          return Visibility.VISIBLE;
        }
      }
      catch (ClassBrowser.NoFilterException e) {
        return Visibility.NOT_VISIBLE;
      }
      return Visibility.NOT_VISIBLE;
    }
  }));

  myMethod = new LabeledComponent<EditorTextFieldWithBrowseButton>();
  final EditorTextFieldWithBrowseButton textFieldWithBrowseButton = new EditorTextFieldWithBrowseButton(myProject, true, 
                                                                                                        JavaCodeFragment.VisibilityChecker.EVERYTHING_VISIBLE, 
                                                                                                        PlainTextLanguage.INSTANCE.getAssociatedFileType());
  new TextFieldCompletionProvider() {
    @Override
    protected void addCompletionVariants(@NotNull String text, int offset, @NotNull String prefix, @NotNull CompletionResultSet result) {
      final String className = getClassName();
      if (className.trim().length() == 0) {
        return;
      }
      final PsiClass testClass = getModuleSelector().findClass(className);
      if (testClass == null) return;
      final JUnitUtil.TestMethodFilter filter = new JUnitUtil.TestMethodFilter(testClass);
      for (PsiMethod psiMethod : testClass.getAllMethods()) {
        if (filter.value(psiMethod)) {
          result.addElement(LookupElementBuilder.create(psiMethod.getName()));
        }
      }
    }
  }.apply(textFieldWithBrowseButton.getChildComponent());
  myMethod.setComponent(textFieldWithBrowseButton);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:45,代码来源:JUnitConfigurable.java

示例3: RunConfigurationEditor

import com.intellij.execution.ui.ClassBrowser; //导入依赖的package包/类
public RunConfigurationEditor(Project project) {

        myProject = project;

        myModuleSelector = new ConfigurationModuleSelector(project, myModule.getComponent());

        ClassBrowser.createApplicationClassBrowser(project, myModuleSelector).setField(myMainClass.getComponent());

        myAnchor = UIUtil.mergeComponentsWithAnchor(repositoryUIDField, repositoryURLField, repositoryClassField,
                specificationsField, workingVersionCheckBox, myMainClass, myModule, myCommonProgramParameters);
    }
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:12,代码来源:RunConfigurationEditor.java


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