if (evt.getKeyCode() == KeyEvent.VK_ENTER && scriptWindow.isVisible())
{
jmb.eval(inputLine.getText());
- history.append("\n$ " + inputLine.getText());
+ addToHistory("$ " + inputLine.getText());
inputLine.setText("");
}
}
return ap;
}
+
+ /**
+ * Append the given text to the history object
+ *
+ * @param text
+ */
+ public void addToHistory(String text)
+ {
+ // actually currently never initialised
+ if (history != null)
+ {
+ history.append("\n" + text);
+ }
+ }
}
appletJmolBinding.showConsole(true);
}
- appletJmolBinding.history.append("\n" + strEcho);
+ appletJmolBinding.addToHistory(strEcho);
}
@Override
if (appletJmolBinding.history != null && strStatus != null
&& !strStatus.equals("Script completed"))
{
- appletJmolBinding.history.append("\n" + strStatus);
+ appletJmolBinding.addToHistory(strStatus);
}
}