+ // ACTIONS
+ //
+
+ /**
+ * Refreshes the menu items in the “connect” and “disconnect” menus.
+ */
+ void refreshNodeMenuItems() {
+ connectMenu.removeAll();
+ for (Action nodeConnectAction: swingInterface.getNodeConnectActions()) {
+ connectMenu.add(nodeConnectAction);
+ }
+ if (connectMenu.getMenuComponentCount() == 0) {
+ JMenuItem noNodeAvailableItem = new JMenuItem(I18n.get("mainWindow.menu.connectNoNodeAvailable.name"));
+ noNodeAvailableItem.setEnabled(false);
+ connectMenu.add(noNodeAvailableItem);
+ }
+ disconnectMenu.removeAll();
+ for (Action nodeDisconnectAction: swingInterface.getNodeDisconnectActions()) {
+ disconnectMenu.add(nodeDisconnectAction);
+ }
+ if (disconnectMenu.getMenuComponentCount() == 0) {
+ JMenuItem noNodeAvailableItem = new JMenuItem(I18n.get("mainWindow.menu.disconnectNoNodeAvailable.name"));
+ noNodeAvailableItem.setEnabled(false);
+ disconnectMenu.add(noNodeAvailableItem);
+ }
+ }
+
+ //