- void refreshNodeMenuItems() {
- connectMenu.removeAll();
- for (Action nodeConnectAction: swingInterface.getNodeConnectActions()) {
- connectMenu.add(nodeConnectAction);
+ void removeNode(Node node) {
+ nodeMenu.remove(nodeMenus.remove(node));
+ statusBar.removeSideComponent(nodeLabels.remove(node));
+ node.removePropertyChangeListener(this);
+ }
+
+ /**
+ * Adds a project to the project pane.
+ *
+ * @param project
+ * The project to add
+ * @param switchToProject
+ * <code>true</code> to switch to the new panel,
+ * <code>false</code> to not change the current panel
+ */
+ void addProject(Project project, boolean switchToProject) {
+ ProjectPanel projectPanel = new ProjectPanel(swingInterface, project);
+ int newTabIndex = projectPane.getTabCount();
+ projectPane.add(project.getName(), projectPanel);
+ projectPane.setToolTipTextAt(newTabIndex, project.getDescription());
+ project.addPropertyChangeListener(this);
+ if (switchToProject) {
+ projectPane.setSelectedIndex(newTabIndex);
+ while (project.getBasePath().length() == 0) {
+ JOptionPane.showMessageDialog(this, I18n.get("mainWindow.information.changeProjectBasePath.message"), I18n.get("mainWindow.information.changeProjectBasePath.title"), JOptionPane.INFORMATION_MESSAGE);
+ projectPanel.changeBasePath();
+ }