Examples of CfgEditor


Examples of it.unina.seclab.jafimon.ui.CfgEditor

  // BEGIN - IUserInterface methods
  // BEGIN - IUserInterface methods
  // BEGIN - IUserInterface methods

  public void defineConfig() {
    CfgEditor ed = new CfgEditor(this);
    ed.setModal(true);
    ed.show();
    logger.trace("La CfgEditor.show() � ritornata");
    if (ed.hasUserConfirmed()) {
      logger.trace(ed.getXmlConfiguration());
     
      // Chiedo il nome all'utente
      String s;
      do {
      s = (String)JOptionPane.showInputDialog(
                          this,
                          "Inserire un nome per questa configurazione\n" +
                          "NOTA: Il nome della configrazione DEVE coincidere\n" +
                          "con il nome del sistema (ad. es.: \"Tomcat5\")",
                          "Nome configurazione",
                          JOptionPane.QUESTION_MESSAGE);

      //If a string was returned, say so.
      } while ((s == null) || (s.length() <= 0));
     
      try {
        String fullName = "custom" + File.separator + s + File.separator + s + ".xml";
        String cfgBody = ed.getXmlConfiguration();
       
        // Prima di istanziare la cfg devo aggiungere i tag:
        // <name>, <type>, <filename>
        cfgBody = aggiungiTag(cfgBody, s, fullName);
       
        Configuration cfg = Configuration.configurationFromString(cfgBody,fullName);
        theCoordinator.newConfig(cfg);
        theCoordinator.selectConfig(fullName);
        currentStatus = CFG_DEFINED_STATUS;
      } catch (Exception e) {
        logger.debug("UI ha rilevato una eccezione in defineConfig");
        JOptionPane.showMessageDialog(this, "Impossibile creare la configurazione. Il messaggio di errore e':\n\"" + e.getLocalizedMessage() + "\"","Eccezione", JOptionPane.ERROR_MESSAGE);
        ed.dispose();
        return;
      }
      ed.dispose();
     
      if (wizardMode) {
        startMonitor();
      }
     
    } else {
      logger.trace("L'utente ha cancellato l'operazione");
      ed.dispose();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.