+ Component tabComponent = projectPane.getComponentAt(componentIndex);
+ if (tabComponent instanceof ProjectPanel) {
+ ((ProjectPanel) tabComponent).updateI18n();
+ }
+ }
+ }
+
+ //
+ // INTERFACE WindowListener
+ //
+
+ /**
+ * {@inheritDoc}
+ */
+ public void windowActivated(WindowEvent e) {
+ /* do nothing. */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void windowClosed(WindowEvent e) {
+ /* do nothing. */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void windowClosing(WindowEvent e) {
+ swingInterface.getQuitAction().actionPerformed(null);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void windowDeactivated(WindowEvent e) {
+ /* do nothing. */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void windowDeiconified(WindowEvent e) {
+ /* do nothing. */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void windowIconified(WindowEvent e) {
+ /* do nothing. */
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void windowOpened(WindowEvent e) {
+ /* do nothing. */
+ }
+
+ //
+ // INTERFACE PropertyChangeListener
+ //
+
+ /**
+ * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
+ Object eventSource = propertyChangeEvent.getSource();
+ String propertyName = propertyChangeEvent.getPropertyName();
+ if (eventSource instanceof Project) {
+ /* 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 projectIndex = getProjectIndex(project);
+ if (projectIndex != -1) {
+ projectPane.setTitleAt(projectIndex, project.getName());
+ projectPane.setToolTipTextAt(projectIndex, project.getDescription());
+ projectPane.repaint();
+ }
+ }
+ } else if (eventSource instanceof Node) {
+ if (propertyName.equals(Node.PROPERTY_NAME)) {
+ Node changedNode = (Node) eventSource;
+ nodeMenus.get(changedNode).setText(changedNode.getName());
+ }