本文整理匯總了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