}
/**
+ * Removes the pane containing the given project.
+ *
+ * @param project
+ * The project whose pane to remove
+ */
+ void removeProject(Project project) {
+ int projectIndex = getProjectIndex(project);
+ projectPane.remove(projectIndex);
+ }
+
+ /**
* @param project
*/
void projectInsertStarted(Project project) {
((ProjectPanel) tabComponent).updateI18n();
}
}
- SwingUtils.repackCentered(this);
}
//
/* if a project was changed, update the tab title and tooltip. */
if (Project.PROPERTY_NAME.equals(propertyName) || Project.PROPERTY_DESCRIPTION.equals(propertyName)) {
Project project = (Project) eventSource;
- int tabCount = projectPane.getTabCount();
- for (int tabIndex = 0; tabIndex < tabCount; tabIndex++) {
- Component tabComponent = projectPane.getComponentAt(tabIndex);
- if (tabComponent instanceof ProjectPanel) {
- Project tabProject = ((ProjectPanel) tabComponent).getProject();
- if (tabProject.equals(project)) {
- projectPane.setTitleAt(tabIndex, project.getName());
- projectPane.setToolTipTextAt(tabIndex, project.getDescription());
- projectPane.repaint();
- }
- }
+ int projectIndex = getProjectIndex(project);
+ if (projectIndex != -1) {
+ projectPane.setTitleAt(projectIndex, project.getName());
+ projectPane.setToolTipTextAt(projectIndex, project.getDescription());
+ projectPane.repaint();
}
}
} else if (eventSource instanceof Node) {
* The project to clone
*/
private void cloneProject(Project project) {
- System.out.println("clone " + project);
/* TODO */
}
* The project to delete
*/
private void deleteProject(Project project) {
- System.out.println("delete " + project);
+ int choice = JOptionPane.showConfirmDialog(mainWindow, I18n.get("mainWindow.question.deleteProject.message", project.getName()), I18n.get("mainWindow.question.deleteProject.title"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
+ if (choice == JOptionPane.NO_OPTION) {
+ return;
+ }
+ core.removeProject(project);
}
//
* {@inheritDoc}
*/
public void projectAdded(Project project) {
+ project.setName(I18n.get("general.newProject.name"));
+ project.setDescription(I18n.get("general.newProject.description", new Date()));
projectAdded(project, true);
}
* @param switchToProject
*/
private void projectAdded(final Project project, boolean switchToProject) {
- project.setName(I18n.get("general.newProject.name"));
- project.setDescription(I18n.get("general.newProject.description", new Date()));
cloneProjectActions.put(project, new I18nAction("mainWindow.button.cloneProject") {
/**
* {@inheritDoc}
*/
public void projectRemoved(Project project) {
- /* TODO - implement */
+ mainWindow.removeProject(project);
+ cloneProjectActions.remove(project);
+ deleteProjectActions.remove(project);
}
/**
mainWindow.error.hostnameUnresolvable.message: The hostname \u201c{0}\u201d can not be resolved!
mainWindow.question.deleteNode.title: Really Remove Node?
-mainWindow.question.deleteNode.message: You are about to remove the node \u201c{0}\u201d! Do you want to continue?
+mainWindow.question.deleteNode.message: <html>You are about to remove the node \u201c{0}\u201d!<br>Do you want to continue?</html>
+
+mainWindow.question.deleteProject.title: Really Delete Project?
+mainWindow.question.deleteProject.message: <html>You are about to remove the project \u201c{0}\u201d!<br>Do you want to continue?</html>
mainWindow.information.changeProjectBasePath.title: Please Enter Base Path!
mainWindow.information.changeProjectBasePath.message: <html>You have created a new project. Please enter a base path<br>to read the files for the project from in the next dialog!</html>
mainWindow.menu.node.item.edit.shortDescription: Edits the node
mainWindow.menu.node.item.edit.longDescription: Edits the node
-mainWindow.menu.node.item.remove.name: Remove
-mainWindow.menu.node.item.remove.mnemonic: VK_R
+mainWindow.menu.node.item.remove.name: Delete
+mainWindow.menu.node.item.remove.mnemonic: VK_D
mainWindow.menu.node.item.remove.accelerator: VK_UNDEFINED
-mainWindow.menu.node.item.remove.shortDescription: Removes the node
-mainWindow.menu.node.item.remove.longDescription: Removes the node
+mainWindow.menu.node.item.remove.shortDescription: Deletes the node
+mainWindow.menu.node.item.remove.longDescription: Deletes the node
#
# the jSite menu
mainWindow.question.deleteNode.title: Node wirklich l\u00f6schen?
mainWindow.question.deleteNode.message: Den Node \u201e{0}\u201c wirklich l\u00f6schen?
+mainWindow.question.deleteProject.title: Projekt wirklich l\u00f6schen?
+mainWindow.question.deleteProject.message: Das Projekt \u201e{0}\u201c wirklich l\u00f6schen?
+
mainWindow.information.changeProjectBasePath.title: Bitte Basispfad angeben!
mainWindow.information.changeProjectBasePath.message: <html>Ein neues Projekt wurde erstellt. Bitte im<br>n\u00e4chsten Dialog einen Basispfad f\u00fcr die Dateien angeben!</html>