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(); }
protected void setLSConsoleVisible(boolean b) { if (b != cbmiLSConsoleShown.isSelected()) cbmiLSConsoleShown.doClick(0); }
protected void setLeftPaneVisible(boolean b) { if (b != cbmiLeftPaneVisible.isSelected()) cbmiLeftPaneVisible.doClick(0); }