本文整理汇总了Java中com.intellij.openapi.module.Module.setOption方法的典型用法代码示例。如果您正苦于以下问题:Java Module.setOption方法的具体用法?Java Module.setOption怎么用?Java Module.setOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.module.Module
的用法示例。
在下文中一共展示了Module.setOption方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: moveMavenModulesToGroup
import com.intellij.openapi.module.Module; //导入方法依赖的package包/类
private void moveMavenModulesToGroup(
final Project project,
final List<Module> mavenModules,
final String[] rootGroup
) {
AccessToken token = null;
final ModifiableModuleModel modifiableModuleModel;
try {
token = ApplicationManager.getApplication().acquireReadActionLock();
modifiableModuleModel = ModuleManager.getInstance(project).getModifiableModel();
for (Module module : mavenModules) {
module.setOption(HybrisConstants.DESCRIPTOR_TYPE, HybrisModuleDescriptorType.MAVEN.name());
final String[] groupPath = modifiableModuleModel.getModuleGroupPath(module);
modifiableModuleModel.setModuleGroupPath(module, ArrayUtils.addAll(rootGroup, groupPath));
}
} finally {
if (token != null) {
token.finish();
}
}
ApplicationManager.getApplication().invokeAndWait(() -> WriteAction.run(modifiableModuleModel::commit));
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:24,代码来源:DefaultMavenConfigurator.java
示例2: moveGradleModulesToGroup
import com.intellij.openapi.module.Module; //导入方法依赖的package包/类
private void moveGradleModulesToGroup(
final Project project,
final List<Module> gradleModules,
final String[] gradleGroup
) {
final ModifiableModuleModel modifiableModuleModel = ModuleManager.getInstance(project).getModifiableModel();
for (Module module : gradleModules) {
if (module == null) {
// https://youtrack.jetbrains.com/issue/IDEA-177512
continue;
}
module.setOption(HybrisConstants.DESCRIPTOR_TYPE, HybrisModuleDescriptorType.GRADLE.name());
modifiableModuleModel.setModuleGroupPath(module, gradleGroup);
}
AccessToken token = null;
try {
token = ApplicationManager.getApplication().acquireWriteActionLock(getClass());
modifiableModuleModel.commit();
} finally {
if (token != null) {
token.finish();
}
}
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:26,代码来源:DefaultGradleConfigurator.java
示例3: moveEclipseModulesToGroup
import com.intellij.openapi.module.Module; //导入方法依赖的package包/类
private void moveEclipseModulesToGroup(
@NotNull final Project project,
@NotNull final List<Module> eclipseModules,
@Nullable final String[] eclipseGroup
) {
final ModifiableModuleModel modifiableModuleModel = ModuleManager.getInstance(project).getModifiableModel();
for (Module module : eclipseModules) {
module.setOption(HybrisConstants.DESCRIPTOR_TYPE, HybrisModuleDescriptorType.ECLIPSE.name());
modifiableModuleModel.setModuleGroupPath(module, eclipseGroup);
}
AccessToken token = null;
try {
token = ApplicationManager.getApplication().acquireWriteActionLock(getClass());
modifiableModuleModel.commit();
} finally {
if (token != null) {
token.finish();
}
}
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:22,代码来源:DefaultEclipseConfigurator.java
示例4: configure
import com.intellij.openapi.module.Module; //导入方法依赖的package包/类
@Override
public void configure(@NotNull final HybrisModuleDescriptor moduleDescriptor, @NotNull final Module javaModule) {
final HybrisModuleDescriptorType descriptorType = moduleDescriptor.getDescriptorType();
javaModule.setOption(HybrisConstants.DESCRIPTOR_TYPE, descriptorType.name());
final boolean hasReadOnlySettings = moduleDescriptor.getRootProjectDescriptor()
.isImportOotbModulesInReadOnlyMode();
final boolean isReadOnlyType = descriptorType == HybrisModuleDescriptorType.OOTB ||
descriptorType == HybrisModuleDescriptorType.PLATFORM ||
descriptorType == HybrisModuleDescriptorType.EXT;
String readOnly = Boolean.valueOf(hasReadOnlySettings && isReadOnlyType).toString();
javaModule.setOption(HybrisConstants.READ_ONLY, readOnly);
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:15,代码来源:DefaultModuleSettingsConfigurator.java