本文整理汇总了Java中com.intellij.openapi.module.ModifiableModuleModel.disposeModule方法的典型用法代码示例。如果您正苦于以下问题:Java ModifiableModuleModel.disposeModule方法的具体用法?Java ModifiableModuleModel.disposeModule怎么用?Java ModifiableModuleModel.disposeModule使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.module.ModifiableModuleModel
的用法示例。
在下文中一共展示了ModifiableModuleModel.disposeModule方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeOldProjectData
import com.intellij.openapi.module.ModifiableModuleModel; //导入方法依赖的package包/类
private static void removeOldProjectData(@NotNull final Project project) {
final ModifiableModuleModel moduleModel = ModuleManager.getInstance(project).getModifiableModel();
for (Module module : moduleModel.getModules()) {
moduleModel.disposeModule(module);
}
final LibraryTable.ModifiableModel libraryModel = ProjectLibraryTable.getInstance(project).getModifiableModel();
for (Library library : libraryModel.getLibraries()) {
libraryModel.removeLibrary(library);
}
ApplicationManager.getApplication().runWriteAction(() -> {
moduleModel.commit();
libraryModel.commit();
});
final GradleSupport gradleSupport = GradleSupport.getInstance();
if (gradleSupport != null) {
gradleSupport.clearLinkedProjectSettings(project);
}
final AntConfigurationBase antConfiguration = AntConfigurationBase.getInstance(project);
for (AntBuildFile antBuildFile : antConfiguration.getBuildFiles()) {
antConfiguration.removeBuildFile(antBuildFile);
}
}
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:27,代码来源:ProjectRefreshAction.java
示例2: removeModule
import com.intellij.openapi.module.ModifiableModuleModel; //导入方法依赖的package包/类
public static void removeModule(@NotNull final Module moduleToRemove,
@Nullable ModifiableRootModel modifiableRootModelToRemove,
@NotNull Collection<ModifiableRootModel> otherModuleRootModels,
@NotNull final ModifiableModuleModel moduleModel) {
// remove all dependencies on the module that is about to be removed
for (final ModifiableRootModel modifiableRootModel : otherModuleRootModels) {
final OrderEntry[] orderEntries = modifiableRootModel.getOrderEntries();
for (final OrderEntry orderEntry : orderEntries) {
if (orderEntry instanceof ModuleOrderEntry && orderEntry.isValid()) {
final Module orderEntryModule = ((ModuleOrderEntry)orderEntry).getModule();
if (orderEntryModule != null && orderEntryModule.equals(moduleToRemove)) {
modifiableRootModel.removeOrderEntry(orderEntry);
}
}
}
}
// destroyProcess editor
if (modifiableRootModelToRemove != null) {
modifiableRootModelToRemove.dispose();
}
// destroyProcess module
moduleModel.disposeModule(moduleToRemove);
}
示例3: testCreateByModule
import com.intellij.openapi.module.ModifiableModuleModel; //导入方法依赖的package包/类
public void testCreateByModule() throws Exception {
final Module module = addModule("x");
final NamedPointer<Module> pointer = ModuleUtilCore.createPointer(module);
assertSame(pointer, ModuleUtilCore.createPointer(module));
assertSame(pointer, ModuleUtilCore.createPointer(getProject(), "x"));
assertSame(module, pointer.get());
assertEquals("x", pointer.getName());
ModifiableModuleModel model = getModuleManager().getModifiableModel();
model.disposeModule(module);
commitModel(model);
assertNull(pointer.get());
assertEquals("x", pointer.getName());
final Module newModule = addModule("x");
assertSame(pointer, ModuleUtilCore.createPointer(newModule));
}
示例4: removeModule
import com.intellij.openapi.module.ModifiableModuleModel; //导入方法依赖的package包/类
public static void removeModule(@Nonnull final Module moduleToRemove,
@Nullable ModifiableRootModel modifiableRootModelToRemove,
@Nonnull Collection<ModifiableRootModel> otherModuleRootModels,
@Nonnull final ModifiableModuleModel moduleModel) {
// remove all dependencies on the module that is about to be removed
for (final ModifiableRootModel modifiableRootModel : otherModuleRootModels) {
final OrderEntry[] orderEntries = modifiableRootModel.getOrderEntries();
for (final OrderEntry orderEntry : orderEntries) {
if (orderEntry instanceof ModuleOrderEntry && orderEntry.isValid()) {
final Module orderEntryModule = ((ModuleOrderEntry)orderEntry).getModule();
if (orderEntryModule != null && orderEntryModule.equals(moduleToRemove)) {
modifiableRootModel.removeOrderEntry(orderEntry);
}
}
}
}
// destroyProcess editor
if (modifiableRootModelToRemove != null) {
modifiableRootModelToRemove.dispose();
}
// destroyProcess module
moduleModel.disposeModule(moduleToRemove);
}
示例5: delete
import com.intellij.openapi.module.ModifiableModuleModel; //导入方法依赖的package包/类
private void delete(@NotNull Module module) {
if (module.isDisposed()) {
return;
}
ModuleManager moduleManager = ModuleManager.getInstance(module.getProject());
ModifiableModuleModel modifiableModel = moduleManager.getModifiableModel();
try {
modifiableModel.disposeModule(module);
}
finally {
modifiableModel.commit();
}
}