}
/**
+ * 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) {