Esempio n. 1
1
  public void bootOptionsReceived(BootEvent bootEvent) {
    log.info(" boot options received " + bootEvent.getNewSessionOptions());

    // reload setting, to ensure correct bootstraps
    ConfigureFactory.getInstance().reloadSettings();

    // If the options are not equal to the string 'null' then we have boot options
    if (!bootEvent.getNewSessionOptions().equals("null")) {
      // check if a session parameter is specified on the command line
      String[] args = new String[TN5250jConstants.NUM_PARMS];
      parseArgs(bootEvent.getNewSessionOptions(), args);

      if (isSpecified("-s", args)) {

        String sd = getParm("-s", args);
        if (sessions.containsKey(sd)) {
          parseArgs(sessions.getProperty(sd), args);
          final String[] args2 = args;
          final String sd2 = sd;
          SwingUtilities.invokeLater(() -> newSession(sd2, args2));
        }
      } else {

        if (args[0].startsWith("-")) {
          SwingUtilities.invokeLater(() -> startNewSession());
        } else {
          final String[] args2 = args;
          final String sd2 = args[0];
          SwingUtilities.invokeLater(() -> newSession(sd2, args2));
        }
      }
    } else {
      SwingUtilities.invokeLater(() -> startNewSession());
    }
  }
Esempio n. 2
0
  private void laden(Path saveName) throws IOException {
    Properties prop = new Properties();

    FileInputStream in = new FileInputStream(saveName.toString());
    prop.load(in);

    for (int i = 0; prop.containsKey(String.format("quellMenu%d", i)); i++)
      quellListModel.addElement(
          new ListItem(
              Paths.get(prop.getProperty(String.format("quellMenu%d", i))),
              Paths.get(prop.getProperty(String.format("quellMenu%d", i)))));
    for (int i = 0; prop.containsKey(String.format("zielMenu%d", i)); i++)
      zielListModel.addElement(
          new ListItem(
              Paths.get(prop.getProperty(String.format("zielMenu%d", i))),
              Paths.get(prop.getProperty(String.format("zielMenu%d", i)))));

    in.close();
  }
Esempio n. 3
0
  public SessionPanel startNewSession() {
    String sel = "";
    if (containsNotOnlyNullValues(sessionArgs) && !sessionArgs[0].startsWith("-")) {
      sel = sessionArgs[0];
    } else {
      sel = getDefaultSession();
    }

    Sessions sess = manager.getSessions();

    if (sel != null && sess.getCount() == 0 && sessions.containsKey(sel)) {
      sessionArgs = new String[TN5250jConstants.NUM_PARMS];
      parseArgs(sessions.getProperty(sel), sessionArgs);
    }

    return newSession(sel, sessionArgs);
  }
Esempio n. 4
0
 public static List<String> loadLastSessionViewNames() {
   List<String> sessionNames = new ArrayList<String>();
   if (sessions.containsKey("emul.startLastView")) {
     String emulview = sessions.getProperty("emul.view", "");
     int idxstart = 0;
     int idxend = emulview.indexOf(PARAM_START_SESSION, idxstart);
     for (; idxend > -1; idxend = emulview.indexOf(PARAM_START_SESSION, idxstart)) {
       String sessname = emulview.substring(idxstart, idxend).trim();
       if (sessname.length() > 0) {
         sessionNames.add(sessname);
       }
       idxstart = idxend + PARAM_START_SESSION.length();
     }
     if (idxstart + PARAM_START_SESSION.length() < emulview.length()) {
       String sessname = emulview.substring(idxstart + PARAM_START_SESSION.length() - 1).trim();
       if (sessname.length() > 0) {
         sessionNames.add(sessname);
       }
     }
   }
   return sessionNames;
 }
Esempio n. 5
0
  private void setDefaultLocale() {

    if (sessions.containsKey("emul.locale")) {
      Locale.setDefault(parseLocal(sessions.getProperty("emul.locale")));
    }
  }