예제 #1
0
 /**
  * Loads parameters in NodeModel.
  *
  * @param settings To load from.
  * @throws InvalidSettingsException If incomplete or wrong.
  */
 public void loadSettings(final NodeSettingsRO settings) throws InvalidSettingsException {
   for (Section section : Section.values())
     if (settings.containsKey(section.name()))
       this.scriptParts.put(section, settings.getIntArray(section.name()));
   this.script = settings.getString(SCRIPT);
   this.jarFiles = settings.getStringArray(JAR_FILES);
   this.parameters = this.loadParameters(settings, PARAMETERS, false);
   this.version = settings.getString(VERSION);
   this.javaHome = settings.getString(JAVA_HOME, "");
 }
예제 #2
0
 /**
  * Loads parameters in Dialog.
  *
  * @param settings To load from.
  */
 public void loadSettingsForDialog(final NodeSettingsRO settings) {
   for (Section section : Section.values())
     if (settings.containsKey(section.name()))
       this.scriptParts.put(section, settings.getIntArray(section.name(), new int[] {0, 0}));
   this.script = settings.getString(SCRIPT, null);
   this.jarFiles = settings.getStringArray(JAR_FILES, new String[0]);
   try {
     this.parameters = this.loadParameters(settings, PARAMETERS, true);
   } catch (InvalidSettingsException e) {
     throw new IllegalStateException("Cannot happen in safe mode", e);
   }
   this.version = settings.getString(VERSION, ScalaSnippet.VERSION_1_X);
   this.javaHome = settings.getString(JAVA_HOME, "");
 }