ArrayList newNames = dialog.getNodeArgumentNames(); ArrayList newValues = dialog.getNodeArgumentValues(); i = component.getPropertyNames(); while (i.hasNext()) { CompositeName name = (CompositeName)i.next(); if (!newNames.contains(name)) { System.out.println("Remove: " + name);  } } for (int j = 0; j < names.size(); j++) { Object newName = newNames.get(j); if (newName instanceof CompositeName) { System.out.println("Existing name: " + newName);  Property p = component.getProperty((CompositeName)newName); Object value = p.getValue(); Object newValue = newValues.get(j); if (value != newValue) { System.out.println("Setting new value: " + newValue); p.setValue(newValue); } } else { System.out.println("Adding new property: " + newName + " " + newValues.get(j)); component.addProperty((String)newName, newValues.get(j)); } }
  public void cmdLineNodeMenuItem_actionPerformed(JTree tree) {    ArrayList names = new ArrayList();    ArrayList values = new ArrayList();    NodeArgumentDialog dialog = new NodeArgumentDialog();    DefaultMutableTreeNode selectedNode =      (DefaultMutableTreeNode)tree.getSelectionPath().getLastPathComponent();    ConsoleTreeObject cto = (ConsoleTreeObject)selectedNode.getUserObject();    ConfigurableComponent component =       (ConfigurableComponent)cto.getComponent();    Iterator i = component.getPropertyNames();    while (i.hasNext()) {      CompositeName name = (CompositeName)i.next();      names.add(name);      values.add(component.getProperty(name).getValue());    }    dialog.setArguments(names, values);    dialog.setVisible(true);  }