ModuleName moduleToRemove = resolveModuleNameInWorkspace(moduleToRemoveString, true);
if (moduleToRemove != null) {
CALWorkspace wkspc = workspaceManager.getWorkspace();
if (wkspc.containsModule(moduleToRemove)) {
Status s = new Status("Remove Status");
workspaceManager.removeModule(moduleToRemove, s);
if (s.getSeverity().getLevel() > Status.Severity.INFO.getLevel()) {
iceLogger.log(Level.INFO, "Failure removing module: " + moduleToRemove);
Status[] msgs = s.getChildren();
for (int u = 0; u < msgs.length; ++u) {
iceLogger.log(Level.INFO, msgs[u].getMessage());
}
}
} else {
Status removeStatus = new Status("Remove Status");
workspaceManager.removeModule(moduleToRemove, true, removeStatus);
}
if (!getWorkspaceManager().hasModuleInProgram(targetModule)) {
targetModule = getDefaultWorkingModuleName();
preferredWorkingModuleName = targetModule;