예제 #1
0
  private void runScript(File script) {
    FileReader fr;
    try {
      fr = new FileReader(script);
    } catch (FileNotFoundException e) {
      HF.showErrorMessage(i18n.getMessage("FileNotFound!"));
      return;
    }

    BufferedReader br = new BufferedReader(fr);

    try {
      String s = br.readLine();
      while (s != null) {
        getLSConsoleModel().setCommandLineText(s);
        getLSConsoleModel().execCommand();
        s = br.readLine();
      }
    } catch (Exception e) {
      HF.showErrorMessage(e);
      return;
    }

    if (!cbmiLSConsoleShown.isSelected()) cbmiLSConsoleShown.doClick(0);

    String s = script.getAbsolutePath();
    recentScripts.remove(s);
    recentScripts.insertElementAt(s, 0);

    while (recentScripts.size() > ClassicPrefs.getRecentScriptsSize()) {
      recentScripts.removeElementAt(recentScripts.size() - 1);
    }

    updateRecentScriptsMenu();
  }
예제 #2
0
 protected void setLSConsoleVisible(boolean b) {
   if (b != cbmiLSConsoleShown.isSelected()) cbmiLSConsoleShown.doClick(0);
 }
예제 #3
0
 protected void setLeftPaneVisible(boolean b) {
   if (b != cbmiLeftPaneVisible.isSelected()) cbmiLeftPaneVisible.doClick(0);
 }