Skip to content

Commit 5a9fc21

Browse files
skalarproduktraumctrueden
authored andcommitted
Expose REPL for use in InterpreterWindow
Closes #22. Signed-off-by: Curtis Rueden <ctrueden@wisc.edu>
1 parent 89fefd5 commit 5a9fc21

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main/java/org/scijava/ui/swing/script/InterpreterWindow.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
import org.scijava.log.LogService;
3838
import org.scijava.plugin.Parameter;
3939
import org.scijava.prefs.PrefService;
40+
import org.scijava.script.ScriptInterpreter;
41+
import org.scijava.script.ScriptREPL;
4042
import org.scijava.script.ScriptService;
4143

4244
/**
@@ -77,6 +79,20 @@ public void dispose() {
7779
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
7880
}
7981

82+
/** Gets the window's associated {@link ScriptREPL}. */
83+
public ScriptREPL getREPL() {
84+
return pane.getREPL();
85+
}
86+
87+
/**
88+
* Gets the associated REPL's active {@link ScriptInterpreter}.
89+
*
90+
* @see #getREPL()
91+
*/
92+
public ScriptInterpreter getInterpreter() {
93+
return pane.getREPL().getInterpreter();
94+
}
95+
8096
@Override
8197
public void dispose() {
8298
// write out interpreter histories, etc., when frame goes away

0 commit comments

Comments
 (0)