本文整理汇总了Java中com.intellij.execution.configurations.ConfigurationUtil类的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationUtil类的具体用法?Java ConfigurationUtil怎么用?Java ConfigurationUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConfigurationUtil类属于com.intellij.execution.configurations包,在下文中一共展示了ConfigurationUtil类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createAppletClassBrowser
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的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
示例2: isAccepted
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
public boolean isAccepted(final PsiClass aClass) {
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@Override
public Boolean compute() {
if (aClass.getQualifiedName() != null && ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS.value(aClass) &&
(aClass.isInheritor(myBase, true) || JUnitUtil.isTestClass(aClass))) {
final CompilerConfiguration compilerConfiguration = CompilerConfiguration.getInstance(getProject());
final VirtualFile virtualFile = PsiUtilCore.getVirtualFile(aClass);
if (virtualFile == null) return false;
return !compilerConfiguration.isExcludedFromCompilation(virtualFile) &&
!ProjectRootManager.getInstance(myProject).getFileIndex().isUnderSourceRootOfType(virtualFile, JavaModuleSourceRootTypes.RESOURCES);
}
return false;
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:TestClassFilter.java
示例3: findMainClass
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
@Nullable
public static PsiClass findMainClass(@NotNull final PsiElement element) {
PsiMethod method = findMainMethod(element);
while(method != null) {
final PsiClass cls = method.getContainingClass();
if(ConfigurationUtil.MAIN_CLASS.value(cls)) {
return cls;
}
method = findMainMethod(method.getParent());
}
return ApplicationConfigurationType.getMainClass(element);
}
开发者ID:defrac,项目名称:defrac-plugin-intellij,代码行数:17,代码来源:DefracRunUtil.java
示例4: isSketchClass
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
public static boolean isSketchClass(PsiClass klass) {
if (klass.getQualifiedName() == null) { return false; }
// klass.isInheritor(myBase, true) && ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS.value(klass)
// @TODO This would only find Processing 3 PApplet classes. Investigate handling Processing 2.0.
return InheritanceUtil.isInheritor(klass, "processing.core.PApplet")
&& ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS.value(klass);
}
开发者ID:mistodev,项目名称:processing-idea,代码行数:10,代码来源:SketchClassFilter.java
示例5: createUIComponents
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
private void createUIComponents() {
myMainClass = new LabeledComponent<>();
myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, (declaration, place) -> {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass) declaration;
if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null) {
return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE;
}
}
return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE;
}
));
}
开发者ID:testIT-LivingDoc,项目名称:livingdoc-intellij,代码行数:15,代码来源:RunConfigurationEditor.java
示例6: createUIComponents
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
private void createUIComponents() {
myMainClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, new JavaCodeFragment.VisibilityChecker() {
@Override
public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass)declaration;
if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null && myModuleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) {
return Visibility.VISIBLE;
}
}
return Visibility.NOT_VISIBLE;
}
}));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ApplicationConfigurable.java
示例7: isAccepted
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
public boolean isAccepted(final PsiClass psiClass) {
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@Override
public Boolean compute() {
if(!ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS.value(psiClass)) return false;
//PsiManager manager = PsiManager.getInstance(project);
//if(manager.getEffectiveLanguageLevel().compareTo(LanguageLevel.JDK_1_5) < 0) return true;
boolean hasTest = TestNGUtil.hasTest(psiClass);
if (hasTest) {
if (checkClassCanBeInstantiated) {
final PsiMethod[] constructors = psiClass.getConstructors();
if (constructors.length > 0) {
boolean canBeInstantiated = false;
for (PsiMethod constructor : constructors) {
if (constructor.getParameterList().getParametersCount() == 0) {
canBeInstantiated = true;
break;
}
if (AnnotationUtil.isAnnotated(constructor, Arrays.asList(GUICE_INJECTION, FACTORY_INJECTION), true)) {
canBeInstantiated = true;
break;
}
}
if (!canBeInstantiated && !AnnotationUtil.isAnnotated(psiClass, GUICE, false)){
return false;
}
}
}
return true;
}
return includeConfig && TestNGUtil.hasConfig(psiClass, TestNGUtil.CONFIG_ANNOTATIONS_FQN_NO_TEST_LEVEL);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:TestClassFilter.java
示例8: isAccepted
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
public boolean isAccepted(final PsiClass psiClass) {
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@Override
public Boolean compute() {
if (!ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS.value(psiClass)) return false;
return TestNGUtil.inheritsITestListener(psiClass);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:TestListenerFilter.java
示例9: createUIComponents
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
/**
* Creates UI Components
*/
private void createUIComponents() {
myMainClass = new LabeledComponent<>();
myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, (declaration, place) -> {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass)declaration;
if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null && myModuleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) {
return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE;
}
}
return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE;
}));
}
开发者ID:asebak,项目名称:embeddedlinux-jvmdebugger-intellij,代码行数:16,代码来源:RunConfigurationEditor.java
示例10: createUIComponents
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
private void createUIComponents() {
myMainClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, new JavaCodeFragment.VisibilityChecker() {
@Override
public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass)declaration;
if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null) {
return Visibility.VISIBLE;
}
}
return Visibility.NOT_VISIBLE;
}
}));
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:ApplicationConfigurable.java
示例11: isAccepted
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
public boolean isAccepted(final PsiClass psiClass) {
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@Override
public Boolean compute() {
if(!ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS.value(psiClass)) return false;
//PsiManager manager = PsiManager.getInstance(project);
//if(manager.getEffectiveLanguageLevel().compareTo(LanguageLevel.JDK_1_5) < 0) return true;
boolean hasTest = TestNGUtil.hasTest(psiClass);
if (hasTest) {
if (checkClassCanBeInstantiated) {
final PsiMethod[] constructors = psiClass.getConstructors();
if (constructors.length > 0) {
boolean canBeInstantiated = false;
for (PsiMethod constructor : constructors) {
if (constructor.getParameterList().getParametersCount() == 0) {
canBeInstantiated = true;
break;
}
if (AnnotationUtil.isAnnotated(constructor, Arrays.asList(GUICE_INJECTION, FACTORY_INJECTION), true)) {
canBeInstantiated = true;
break;
}
}
if (!canBeInstantiated){
return false;
}
}
}
return true;
}
return includeConfig && TestNGUtil.hasConfig(psiClass);
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:TestClassFilter.java
示例12: isAccepted
import com.intellij.execution.configurations.ConfigurationUtil; //导入依赖的package包/类
public boolean isAccepted(final PsiClass aClass) {
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@Override
public Boolean compute() {
return ConfigurationUtil.PUBLIC_INSTANTIATABLE_CLASS.value(aClass) &&
(aClass.isInheritor(myBase, true) || JUnitUtil.isTestClass(aClass))
&& !CompilerConfiguration.getInstance(getProject()).isExcludedFromCompilation(PsiUtilCore.getVirtualFile(aClass));
}
});
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:TestClassFilter.java
注:本文中的com.intellij.execution.configurations.ConfigurationUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论