Ejemplo n.º 1
0
 /** Open an xml param defaults file */
 public void doOpen() {
   String filename = FileManager.getReadFile(FileManager.FILTER_XML);
   if (filename == null) {
     return;
   }
   resources.addResource(filename);
   int index = resources.size() - 1;
   addList(resources.getRoot(index), index);
 }
Ejemplo n.º 2
0
 /**
  * Handle any Gui actions.
  *
  * @param ae The <code>ActionEvent</code>.
  */
 public void actionPerformed(ActionEvent ae) {
   String cmd = ae.getActionCommand();
   if (cmd.equals(CMD_BROWSE)) {
     String filename = FileManager.getReadFile(FILTER_XML);
     if (filename == null) {
       return;
     }
     urlBox.setSelectedItem(filename);
   } else if (cmd.equals(GuiUtils.CMD_OK)) {
     doLoad();
   } else {
     // Here, the base class ChooserPanel will check if this command
     // is the load or cancel command.
     super.actionPerformed(ae);
   }
 }
Ejemplo n.º 3
0
 /** Import an xml param defaults file */
 public void doImport() {
   try {
     String filename = FileManager.getReadFile(FileManager.FILTER_XML);
     if (filename == null) {
       return;
     }
     Element root = XmlUtil.getRoot(IOUtil.readContents(filename));
     if (root == null) {
       return;
     }
     List infos = createParamInfoList(root);
     ParamDefaultsTable table = getCurrentTable();
     table.getParamInfoList().addAll(infos);
     table.tableChanged();
     saveData();
   } catch (Exception exc) {
     LogUtil.printException(log_, "Error importing file", exc);
   }
 }