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


Java ClassFilter.ClassFilterWithScope方法代码示例

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


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

示例1: showDialog

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
@Nullable
protected String showDialog() {
  final ClassFilter.ClassFilterWithScope classFilter;
  try {
    classFilter = getFilter();
  }
  catch (NoFilterException e) {
    final MessagesEx.MessageInfo info = e.getMessageInfo();
    info.showNow();
    return null;
  }
  final TreeClassChooser dialog = createClassChooser(classFilter);
  configureDialog(dialog);
  dialog.showDialog();
  final PsiClass psiClass = dialog.getSelected();
  if (psiClass == null) return null;
  onClassChoosen(psiClass);
  return psiClass.getQualifiedName();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ClassBrowser.java

示例2: createAppletClassBrowser

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
public static ClassBrowser createAppletClassBrowser(final Project project,
                                                    final ConfigurationModuleSelector moduleSelector) {
  final String title = ExecutionBundle.message("choose.applet.class.dialog.title");
  return new MainClassBrowser(project, moduleSelector, title) {

    @Override
    protected TreeClassChooser createClassChooser(ClassFilter.ClassFilterWithScope classFilter) {
      final Module module = moduleSelector.getModule();
      final GlobalSearchScope scope =
        module == null ? GlobalSearchScope.allScope(myProject) : GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module);
      final PsiClass appletClass = JavaPsiFacade.getInstance(project).findClass("java.applet.Applet", scope);
      return TreeClassChooserFactory.getInstance(getProject())
        .createInheritanceClassChooser(title, classFilter.getScope(), appletClass, false, false,
                                       ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ClassBrowser.java

示例3: getFilter

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
protected ClassFilter.ClassFilterWithScope getFilter() throws NoFilterException {
  final Module module = myModuleSelector.getModule();
  final GlobalSearchScope scope;
  if (module == null) {
    scope = GlobalSearchScope.allScope(myProject);
  }
  else {
    scope = GlobalSearchScope.moduleWithDependenciesAndLibrariesScope(module);
  }
  final ClassFilter filter = createFilter(module);
  return new ClassFilter.ClassFilterWithScope() {
    public GlobalSearchScope getScope() {
      return scope;
    }

    public boolean isAccepted(final PsiClass aClass) {
      return filter == null || filter.isAccepted(aClass);
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ClassBrowser.java

示例4: showDialog

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
@Override
protected String showDialog() {
  ClassFilter.ClassFilterWithScope filter;
  try {
    filter = getFilter();
  }
  catch (MessageInfoException e) {
    MessagesEx.MessageInfo message = e.getMessageInfo();
    message.showNow();
    return null;
  }
  TreeClassChooser chooser = TreeClassChooserFactory.getInstance(getProject()).createWithInnerClassesScopeChooser("Choose Test Class", filter.getScope(), filter, null);
  init(chooser);
  chooser.showDialog();
  PsiClass psiclass = chooser.getSelected();
  if (psiclass == null) {
    return null;
  } else {
    onClassChoosen(psiclass);
    return psiclass.getQualifiedName();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:TestClassBrowser.java

示例5: getFilter

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
protected ClassFilter.ClassFilterWithScope getFilter() throws NoFilterException {
  final ConfigurationModuleSelector moduleSelector = getModuleSelector();
  final Module module = moduleSelector.getModule();
  if (module == null) {
    throw NoFilterException.moduleDoesntExist(moduleSelector);
  }
  final ClassFilter.ClassFilterWithScope classFilter;
  try {
    final JUnitConfiguration configurationCopy =
      new JUnitConfiguration(ExecutionBundle.message("default.junit.configuration.name"), getProject(),
                             JUnitConfigurationType.getInstance().getConfigurationFactories()[0]);
    applyEditorTo(configurationCopy);
    classFilter = TestClassFilter
      .create(configurationCopy.getTestObject().getSourceScope(), configurationCopy.getConfigurationModule().getModule());
  }
  catch (JUnitUtil.NoJUnitException e) {
    throw NoFilterException.noJUnitInModule(module);
  }
  return classFilter;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:JUnitConfigurable.java

示例6: DefracMainClassBrowser

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
public DefracMainClassBrowser(@NotNull final Project project,
                              @NotNull final ConfigurationModuleSelector moduleSelector) {
  super(project, "Choose main class");

  this.moduleSelector = moduleSelector;
  this.classFilter = new ClassFilter.ClassFilterWithScope() {
    @Override
    public GlobalSearchScope getScope() {
      return GlobalSearchScope.moduleScope(moduleSelector.getModule());
    }

    @Override
    public boolean isAccepted(final PsiClass psiClass) {
      return DefracRunUtil.isValidMainClass(moduleSelector.getModule(), psiClass);
    }
  };
}
 
开发者ID:defrac,项目名称:defrac-plugin-intellij,代码行数:18,代码来源:DefracMainClassBrowser.java

示例7: showDialog

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
@Nullable
protected String showDialog() {
  final ClassFilter.ClassFilterWithScope classFilter;
  try {
    classFilter = getFilter();
  }
  catch (NoFilterException e) {
    final MessagesEx.MessageInfo info = e.getMessageInfo();
    info.showNow();
    return null;
  }
  final TreeClassChooser dialog = createClassChooser(classFilter);
  configureDialog(dialog);
  dialog.showDialog();
  final PsiClass psiClass = dialog.getSelected();
  if (psiClass == null) return null;
  onClassChoosen(psiClass);
  return JavaExecutionUtil.getRuntimeQualifiedName(psiClass);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:ClassBrowser.java

示例8: showDialog

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
@Override
protected String showDialog() {
  ClassFilter.ClassFilterWithScope filter;
  try {
    filter = getFilter();
  }
  catch (MessageInfoException e) {
    MessagesEx.MessageInfo message = e.getMessageInfo();
    message.showNow();
    return null;
  }
  TreeClassChooser chooser = TreeClassChooserFactory.getInstance(getProject()).createWithInnerClassesScopeChooser("Choose Test Class", filter.getScope(), filter, null);
  init(chooser);
  chooser.showDialog();
  PsiClass psiclass = chooser.getSelected();
  if (psiclass == null) {
    return null;
  } else {
    onClassChoosen(psiclass);
    return JavaExecutionUtil.getRuntimeQualifiedName(psiclass);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:TestClassBrowser.java

示例9: getFilter

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
public ClassFilter.ClassFilterWithScope getFilter() throws MessageInfoException {
  TestNGConfiguration config = new TestNGConfiguration("<no-name>", getProject(), TestNGConfigurationType.getInstance().getConfigurationFactories()[0]);
  editor.applyEditorTo(config);
  GlobalSearchScope scope = getSearchScope(config.getModules());
  if (scope == null) {
    scope = GlobalSearchScope.allScope(getProject());
  }
  return new TestClassFilter(scope, getProject(), false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:TestClassBrowser.java

示例10: getFilter

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
@Override
protected ClassFilter.ClassFilterWithScope getFilter() throws NoFilterException {
  return new ClassFilter.ClassFilterWithScope() {
    @Override
    public GlobalSearchScope getScope() {
      return GlobalSearchScope.projectScope(getProject());
    }

    @Override
    public boolean isAccepted(PsiClass aClass) {
      return InheritanceUtil.isInheritor(aClass, getApplicationClass());
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:JavaFxApplicationClassBrowser.java

示例11: getFilter

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
public ClassFilter.ClassFilterWithScope getFilter() throws MessageInfoException {
  TestNGConfiguration config = new TestNGConfiguration("<no-name>", getProject(), TestNGConfigurationType.getInstance().getConfigurationFactories()[0]);
  editor.applyEditorTo(config);
  GlobalSearchScope scope = getSearchScope(config.getModules());
  if (scope == null) {
    throw new MessageInfoException(new MessagesEx.MessageInfo(getProject(), "No classes found in project", "Can't Browse Tests"));
  }
  return new TestClassFilter(scope, getProject(), false);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:TestClassBrowser.java

示例12: createClassChooser

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
protected TreeClassChooser createClassChooser(ClassFilter.ClassFilterWithScope classFilter) {
  return TreeClassChooserFactory.getInstance(getProject())
    .createWithInnerClassesScopeChooser(myTitle, classFilter.getScope(), classFilter, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ClassBrowser.java

示例13: getFilter

import com.intellij.ide.util.ClassFilter; //导入方法依赖的package包/类
@Override
protected ClassFilter.ClassFilterWithScope getFilter() throws NoFilterException {
  return classFilter;
}
 
开发者ID:defrac,项目名称:defrac-plugin-intellij,代码行数:5,代码来源:DefracMainClassBrowser.java


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