fileMenu.setToolTipText("Configure communities, hosts and nodes, save, or quit");
fileMenu.setToolTipText("Save, export configuration, or quit"); communityMenu = new JMenu(COMMUNITY_MENU); communityMenu.setToolTipText("Configure communities"); configureMenu = new JMenu(CONFIGURE_MENU); configureMenu.setToolTipText("Configure hosts and nodes");
  public ExperimentBuilder(CSMART csmart, Experiment experiment) {    this.csmart = csmart;    createLogger();    setExperiment(experiment);    JMenuBar menuBar = new JMenuBar();    getRootPane().setJMenuBar(menuBar);    JMenu fileMenu = new JMenu(FILE_MENU);    fileMenu.setToolTipText("Configure communities, hosts and nodes, save, or quit");    communityPanel = new CommunityPanel(experiment);    newCommunityMenuItem = new JMenuItem(communityPanel.newCommunityAction);    fileMenu.add(newCommunityMenuItem);    viewCommunityMenuItem = new JMenuItem(communityPanel.viewCommunityAction);    fileMenu.add(viewCommunityMenuItem);    globalCommandLineMenuItem =       new JMenuItem(HostConfigurationBuilder.GLOBAL_COMMAND_LINE_MENU_ITEM);    globalCommandLineMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.setGlobalCommandLine();        }      });    fileMenu.add(globalCommandLineMenuItem);    newHostMenuItem =       new JMenuItem(HostConfigurationBuilder.NEW_HOST_MENU_ITEM);    newHostMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.createHost();        }      });    fileMenu.add(newHostMenuItem);    newNodeMenu = new JMenu(HostConfigurationBuilder.NEW_NODE_MENU_ITEM);    newUnassignedNodeMenuItem = new JMenuItem("Unassigned");    newUnassignedNodeMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.createUnassignedNode();        }      });    newNodeMenu.add(newUnassignedNodeMenuItem);    newAssignedNodeMenuItem = new JMenuItem("On Host");    newAssignedNodeMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.createAssignedNode();        }      });    newNodeMenu.add(newAssignedNodeMenuItem);    fileMenu.add(newNodeMenu);    commandLineMenuItem =       new JMenuItem(HostConfigurationBuilder.NODE_COMMAND_LINE_MENU_ITEM);    commandLineMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.setNodeCommandLine();        }      });    fileMenu.add(commandLineMenuItem);    describeHostMenuItem =       new JMenuItem(HostConfigurationBuilder.DESCRIBE_HOST_MENU_ITEM);    describeHostMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.setHostDescription();        }      });    fileMenu.add(describeHostMenuItem);    describeNodeMenuItem =       new JMenuItem(HostConfigurationBuilder.DESCRIBE_NODE_MENU_ITEM);    describeNodeMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.setNodeDescription();        }      });    fileMenu.add(describeNodeMenuItem);    hostTypeMenuItem =       new JMenuItem(HostConfigurationBuilder.HOST_TYPE_MENU_ITEM);    hostTypeMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.setHostType();        }      });    fileMenu.add(hostTypeMenuItem);    hostLocationMenuItem =       new JMenuItem(HostConfigurationBuilder.HOST_LOCATION_MENU_ITEM);    hostLocationMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.setHostLocation();        }      });    fileMenu.add(hostLocationMenuItem);    deleteHostMenuItem =       new JMenuItem(HostConfigurationBuilder.DELETE_HOST_MENU_ITEM);    deleteHostMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.deleteHost();        }      });    fileMenu.add(deleteHostMenuItem);    deleteNodeMenuItem =       new JMenuItem(HostConfigurationBuilder.DELETE_NODE_MENU_ITEM);    deleteNodeMenuItem.addActionListener(new ActionListener() {        public void actionPerformed(ActionEvent e) {          hcb.deleteNode();        }      });    fileMenu.add(deleteNodeMenuItem);    fileMenu.addSeparator();    for (int i = 0; i < fileActions.length; i++) {      fileMenu.add(fileActions[i]);    }    fileMenu.addSeparator();    for (int i = 0; i < hnaActions.length; i++) {      fileMenu.add(hnaActions[i]);    }        fileMenu.addMenuListener(myMenuListener);    findMenu = new JMenu(FIND_MENU);    findMenu.setToolTipText("Find a host, node, or agent.");    for (int i = 0; i < findActions.length; i++) {      findMenu.add(findActions[i]);    }        JMenu helpMenu = new JMenu(HELP_MENU);    helpMenu.setToolTipText("Display documentation.");    for (int i = 0; i < helpActions.length; i++) {      helpMenu.add(helpActions[i]);    }    menuBar.add(fileMenu);    menuBar.add(findMenu);    menuBar.add(helpMenu);    setJMenuBar(menuBar);    tabbedPane = new JTabbedPane();    tabbedPane.addChangeListener(new ChangeListener() {      public void stateChanged(ChangeEvent e) {        if (tabbedPane.getSelectedComponent().equals(hcb))          findMenu.setEnabled(true);        else          findMenu.setEnabled(false);      }    });    propertyBuilder = new UnboundPropertyBuilder(experiment, this);    tabbedPane.add("Properties", propertyBuilder);    hcb =       new HostConfigurationBuilder(experiment, this);    tabbedPane.add("Configurations", hcb);    tabbedPane.add("Communities", communityPanel);    // Only need to add the ThreadBuilder if there are threads    if (DBUtils.containsCMTAssembly(experiment.getExperimentID())) {      threadBuilder = new ThreadBuilder(experiment);    } else {      threadBuilder = new ThreadBuilder(null);    }    tabbedPane.add("Threads", threadBuilder);    // only display trial builder for non-database experiments    //    trialBuilder = new TrialBuilder(experiment);    //    tabbedPane.add("Trials", trialBuilder);    // after starting all the editors, set experiment editability to false    experiment.setEditInProgress(true);    getContentPane().add(tabbedPane);    pack();    setSize(660, 600);    setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);    addWindowListener(new WindowAdapter() {      public void windowClosing(WindowEvent e) {        if(!ExperimentBuilder.this.getGlassPane().isVisible()) {          exit();        }      }    });    show();  }