本文整理汇总了Java中com.intellij.execution.actions.ConfigurationContext.getModule方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationContext.getModule方法的具体用法?Java ConfigurationContext.getModule怎么用?Java ConfigurationContext.getModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.actions.ConfigurationContext
的用法示例。
在下文中一共展示了ConfigurationContext.getModule方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupConfigurationFromContext
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
@Override
protected boolean setupConfigurationFromContext(MuleConfiguration muleConfiguration, ConfigurationContext configurationContext, Ref<PsiElement> ref)
{
final Location location = configurationContext.getLocation();
if (location != null)
{
final boolean muleFile = MuleConfigUtils.isMuleFile(location.getPsiElement().getContainingFile());
final Module module = configurationContext.getModule();
if (muleFile && module != null)
{
muleConfiguration.setModule(module);
muleConfiguration.setName(StringUtils.capitalize(module.getName()));
return true;
}
}
return false;
}
示例2: isConfigurationFromContext
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
@Override
public boolean isConfigurationFromContext(WeaveConfiguration muleConfiguration, ConfigurationContext configurationContext)
{
final Module module = configurationContext.getModule();
final PsiFile containingFile = configurationContext.getPsiLocation().getContainingFile();
if (containingFile == null)
{
return false;
}
final String canonicalPath = containingFile.getVirtualFile().getCanonicalPath();
final String weaveFile = muleConfiguration.getWeaveFile();
if (weaveFile == null)
{
return false;
}
return module != null && module.equals(muleConfiguration.getModule()) && weaveFile.equals(canonicalPath);
}
示例3: setupConfigurationModule
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
protected boolean setupConfigurationModule(@Nullable ConfigurationContext context, T configuration) {
if (context != null) {
final RunnerAndConfigurationSettings template = context.getRunManager().getConfigurationTemplate(getConfigurationFactory());
final Module contextModule = context.getModule();
final Module predefinedModule = ((ModuleBasedConfiguration)template.getConfiguration()).getConfigurationModule().getModule();
if (predefinedModule != null) {
configuration.setModule(predefinedModule);
return true;
}
final Module module = findModule(configuration, contextModule);
if (module != null) {
configuration.setModule(module);
return true;
}
}
return false;
}
示例4: setupConfigurationModule
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
protected boolean setupConfigurationModule(@Nullable ConfigurationContext context, ModuleBasedConfiguration configuration) {
if (context != null) {
final RunnerAndConfigurationSettings template =
((RunManagerImpl)context.getRunManager()).getConfigurationTemplate(getConfigurationFactory());
final Module contextModule = context.getModule();
final Module predefinedModule = ((ModuleBasedConfiguration)template.getConfiguration()).getConfigurationModule().getModule();
if (predefinedModule != null) {
configuration.setModule(predefinedModule);
return true;
}
final Module module = findModule(configuration, contextModule);
if (module != null) {
configuration.setModule(module);
return true;
}
}
return false;
}
示例5: getActivityClass
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
@Nullable
private static PsiClass getActivityClass(Location location, ConfigurationContext context) {
final Module module = context.getModule();
if (module == null) return null;
location = JavaExecutionUtil.stepIntoSingleClass(location);
if (location == null) {
return null;
}
PsiElement element = location.getPsiElement();
JavaPsiFacade facade = JavaPsiFacade.getInstance(element.getProject());
GlobalSearchScope scope = module.getModuleWithDependenciesAndLibrariesScope(true);
PsiClass activityClass = facade.findClass(AndroidUtils.ACTIVITY_BASE_CLASS_NAME, scope);
if (activityClass == null) return null;
PsiClass elementClass = PsiTreeUtil.getParentOfType(element, PsiClass.class, false);
while (elementClass != null) {
if (elementClass.isInheritor(activityClass, true)) {
return elementClass;
}
elementClass = PsiTreeUtil.getParentOfType(elementClass, PsiClass.class);
}
return null;
}
示例6: isConfigurationFromContext
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
@Override
public boolean isConfigurationFromContext(ExternalSystemRunConfiguration configuration, ConfigurationContext context) {
if (configuration == null) return false;
if (!GradleConstants.SYSTEM_ID.equals(configuration.getSettings().getExternalSystemId())) return false;
final PsiPackage psiPackage = JavaRuntimeConfigurationProducerBase.checkPackage(context.getPsiLocation());
if (psiPackage == null) return false;
if (context.getModule() == null) return false;
if (!StringUtil.equals(
context.getModule().getOptionValue(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY),
configuration.getSettings().getExternalProjectPath())) {
return false;
}
if (!configuration.getSettings().getTaskNames().containsAll(TASKS_TO_RUN)) return false;
final String scriptParameters = configuration.getSettings().getScriptParameters() + ' ';
return psiPackage.getQualifiedName().isEmpty()
? scriptParameters.contains("--tests * ")
: scriptParameters.contains(String.format("--tests %s.* ", psiPackage.getQualifiedName()));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AllInPackageGradleConfigurationProducer.java
示例7: isConfigurationFromContext
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
@Override
public boolean isConfigurationFromContext(MuleConfiguration muleConfiguration, ConfigurationContext configurationContext)
{
final Module module = configurationContext.getModule();
if (module != null) {
Module[] modules = muleConfiguration.getModules();
for (Module m : modules) {
if (module.equals(m))
return true;
}
}
return false;
}
示例8: getAndroidModule
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
@Nullable
public static Module getAndroidModule(ConfigurationContext context) {
Module module = context.getModule();
if (module == null || AndroidFacet.getInstance(module) == null) {
return null;
}
return module;
}
示例9: setupConfigurationFromContext
import com.intellij.execution.actions.ConfigurationContext; //导入方法依赖的package包/类
@Override
protected boolean setupConfigurationFromContext(ExternalSystemRunConfiguration configuration,
ConfigurationContext context,
Ref<PsiElement> sourceElement) {
final PsiPackage psiPackage = JavaRuntimeConfigurationProducerBase.checkPackage(context.getPsiLocation());
if (psiPackage == null) return false;
sourceElement.set(psiPackage);
final Module module = context.getModule();
if (module == null) return false;
if (!StringUtil.equals(
module.getOptionValue(ExternalSystemConstants.EXTERNAL_SYSTEM_ID_KEY),
GradleConstants.SYSTEM_ID.toString())) {
return false;
}
final String linkedGradleProject = module.getOptionValue(ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);
if (linkedGradleProject == null) return false;
configuration.getSettings().setExternalProjectPath(linkedGradleProject);
configuration.getSettings().setTaskNames(TASKS_TO_RUN);
if (psiPackage.getQualifiedName().isEmpty()) {
configuration.getSettings().setScriptParameters("--tests *");
}
else {
configuration.getSettings()
.setScriptParameters(String.format("--tests %s.*", psiPackage.getQualifiedName()));
}
configuration.setName(suggestName(psiPackage, module));
return true;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:AllInPackageGradleConfigurationProducer.java