(String)ComboDialog.showDialog(this, "Plugin", new Vector(sortedNames));
(String)ComboDialog.showDialog(this, "Select Plugin or Enter New Name", new Vector(sortedNames));
  private void addPlugin() {    // get plugins from all existing agents    Enumeration components = componentToNode.keys();    ArrayList pluginNames = new ArrayList();    ArrayList pluginClasses = new ArrayList();    while (components.hasMoreElements()) {      Object o = components.nextElement();      if (o instanceof PluginComponent) {        PluginComponent plugin = (PluginComponent)o;        String name = ((BaseComponent)plugin).getShortName();        // if name is prefixed with an agentname|, strip it off        int index = name.indexOf('|');        if (index != -1)          name = name.substring(index+1);        if (!pluginNames.contains(name)) {          pluginNames.add(name);          pluginClasses.add(plugin.getComponentClassName());        }      }    }    ArrayList sortedNames = (ArrayList)pluginNames.clone();    Collections.sort(sortedNames);    String name =       (String)ComboDialog.showDialog(this, "Plugin", new Vector(sortedNames));    if (name == null)      return;    name = name.trim();    if (name.length() == 0)      return;    String className = null;    int index = pluginNames.indexOf(name);    if (index > -1 && index < pluginNames.size())      className = (String)pluginClasses.get(index);    else {      className =        (String)JOptionPane.showInputDialog(this, "Enter Plugin Full Class",                                            "Plugin Class",                                            JOptionPane.QUESTION_MESSAGE,                                            null, null, className);      if (className == null) return;      className = className.trim(); // trim white space      if (className.length() == 0) return;    }    PluginComponent plugin =       (PluginComponent)new PluginBase(name, className, null);    addBaseComponent(plugin);  }