use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class TestNGConfigurationType method isConfigurationByLocation.
public boolean isConfigurationByLocation(RunConfiguration runConfiguration, Location location) {
TestNGConfiguration config = (TestNGConfiguration) runConfiguration;
TestData testobject = config.getPersistantData();
if (testobject == null)
return false;
else {
final PsiElement element = location.getPsiElement();
final TestNGTestObject testNGTestObject = TestNGTestObject.fromConfig(config);
if (testNGTestObject != null && testNGTestObject.isConfiguredByElement(element)) {
final Module configurationModule = config.getConfigurationModule().getModule();
if (Comparing.equal(location.getModule(), configurationModule))
return true;
final Module predefinedModule = ((TestNGConfiguration) RunManagerEx.getInstanceEx(location.getProject()).getConfigurationTemplate(myFactory).getConfiguration()).getConfigurationModule().getModule();
return Comparing.equal(predefinedModule, configurationModule);
} else {
return false;
}
}
}
use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class GroupBrowser method showDialog.
@Nullable
@Override
protected String showDialog() {
TestClassFilter filter;
Module module = editor.getModuleSelector().getModule();
if (module == null) {
filter = new TestClassFilter(GlobalSearchScope.projectScope(getProject()), getProject(), false);
} else {
filter = new TestClassFilter(GlobalSearchScope.moduleScope(module), getProject(), false);
}
PsiClass[] classes = TestNGUtil.getAllTestClasses(filter, true);
if (classes == null || classes.length == 0) {
Messages.showMessageDialog(getField(), "No tests found in project", "Cannot Browse Groups", Messages.getInformationIcon());
return null;
} else {
return GroupList.showDialog(classes, getField());
}
}
use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class TestNGTestObject method getSearchScope.
@NotNull
protected GlobalSearchScope getSearchScope() {
final TestData data = myConfig.getPersistantData();
final Module module = myConfig.getConfigurationModule().getModule();
if (data.TEST_OBJECT.equals(TestType.PACKAGE.getType())) {
SourceScope scope = myConfig.getPersistantData().getScope().getSourceScope(myConfig);
if (scope != null) {
return scope.getGlobalSearchScope();
}
} else if (module != null) {
return GlobalSearchScope.moduleWithDependenciesScope(module);
}
return GlobalSearchScope.projectScope(myConfig.getProject());
}
use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class CCCreateCourseArchive method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
final Module module = e.getData(LangDataKeys.MODULE);
if (project == null || module == null) {
return;
}
CreateCourseArchiveDialog dlg = new CreateCourseArchiveDialog(project, this);
dlg.show();
if (dlg.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
return;
}
createCourseArchive(project, module, myZipName, myLocationDir, true);
EduUsagesCollector.createdCourseArchive();
}
use of com.intellij.openapi.module.Module in project intellij-community by JetBrains.
the class RunPythonConsoleAction method update.
@Override
public void update(final AnActionEvent e) {
e.getPresentation().setVisible(true);
e.getPresentation().setEnabled(false);
final Project project = e.getData(CommonDataKeys.PROJECT);
if (project != null) {
Pair<Sdk, Module> sdkAndModule = PydevConsoleRunner.findPythonSdkAndModule(project, e.getData(LangDataKeys.MODULE));
if (sdkAndModule.first != null) {
e.getPresentation().setEnabled(true);
}
}
}
Aggregations