}
}
}
}
Status removeStatus = new Status("Remove status");
getWorkspaceManager().removeModule(moduleToRemove, false, removeStatus);
// update the perspective if the working module no longer exists (eg. because of compile failure..)
if (perspective.getWorkingModule() == null) {
ModuleName newWorkingModuleName = getInitialWorkingModuleName(workspaceManager.getWorkspace());
if (newWorkingModuleName != null) {
if (removingCurrentModule) {
changeModuleAndNewTableTop(newWorkingModuleName, true);
} else {
perspective.setWorkingModule(newWorkingModuleName);
}
}
// Change the current module if we just removed it.
if (removingCurrentModule) {
// clear the undo stack and dirty edit.
extendedUndoManager.discardAllEdits();
editToUndoWhenNonDirty = null;
updateUndoWidgets();
}
// Also update the window title.
updateWindowTitle();
}
// mark workspace as changed in Gem Browser
getGemBrowser().markWorkspaceDirty();
// Refresh the gem browser and navigator to show any new gems
getGemBrowser().refresh();
getNavigatorOwner().refresh();
// Show any problems which were encountered during module resource removal.
if (removeStatus.getSeverity().compareTo(Status.Severity.WARNING) >= 0 ) {
String dialogTitle = getResourceString("RemoveModuleDialogTitle");
String message = "Problems were encountered:\n" + removeStatus.getDebugMessage();
JOptionPane.showMessageDialog(GemCutter.this, message, dialogTitle, JOptionPane.WARNING_MESSAGE);
}
}