}
/**
+ * 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) {
swingInterface.getQuitAction().updateI18n();
swingInterface.getAddNodeAction().updateI18n();
swingInterface.getAddProjectAction().updateI18n();
- swingInterface.getCloneProjectAction().updateI18n();
- swingInterface.getDeleteProjectAction().updateI18n();
swingInterface.getHelpAboutAction().updateI18n();
jSiteMenu.updateI18n();
nodeMenu.updateI18n();
swingInterface.getNodeEditAction(node).updateI18n();
swingInterface.getNodeDeleteAction(node).updateI18n();
}
+ for (Project project: swingInterface.getProjects()) {
+ swingInterface.getCloneProjectAction(project).updateI18n();
+ swingInterface.getDeleteProjectAction(project).updateI18n();
+ }
for (I18nAction languageAction: swingInterface.getLanguageActions()) {
languageAction.updateI18n();
}
((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) {