private void disableMainConnectionMenus() {
        if (dummyMenuItem.getParent() instanceof JMenuBar == false)
            return;
        JMenuBar menuBar = (JMenuBar) dummyMenuItem.getParent();

        MenuElement item = JTAUtils.findMenuElement(menuBar, "Connect");
        if (item instanceof JMenuItem == true) {
            JMenuItem mItem = (JMenuItem) item;
            mItem.setEnabled(false);
        }
        item = JTAUtils.findMenuElement(menuBar, "Disconnect");
        if (item instanceof JMenuItem == true) {
            JMenuItem mItem = (JMenuItem) item;
            mItem.setEnabled(false);
        }
        
//begin add @sp 12.05.11 disconnect on exit
        item = JTAUtils.findMenuElement(menuBar, "Exit");
        if (item instanceof JMenuItem == true) {
            JMenuItem mItem = (JMenuItem) item;
            ActionListener[] listeners = mItem.getActionListeners();
            for (int i=0; i<listeners.length; i++){
            	mItem.removeActionListener(listeners[i]);
            }
            mItem.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                	 JMenuBar menuBar = (JMenuBar) dummyMenuItem.getParent();
                	 JFrame frame = ((JFrame)menuBar.getParent().getParent().getParent());
                	 DisableMainConnectionMenu.this.bus.broadcast(new SocketRequest());
                     frame.setVisible(false);
                     frame.dispose();
                     System.exit(0);
                }
              });
        }
//end add @sp 12.05.11 disconnect on exit
        
        // TODO: remove the dummy menu
    }