Terminating a Language Console?
Hi all,
I'm using the new Language Console functionality, but I'm not using it with an external process - I'm using it as an in-process library. It works well, except that I can't indicate to the console when my REPL has terminated. Digging into the code I can see that ConsoleViewImpl has a ConsoleState field, but the only way to modify this is by calling attachToProcess. Ideally I'd like a more flexible way of setting the state, is there any way I can achieve this short of using reflection?
Edit: just to be clear, what I'm actually trying to achieve is to disable the editable part of the REPL so the user can't enter any more text.
Thanks,
Colin
请先登录再写评论。
Can anyone give me any pointers on this? I've been looking through the source code without any joy, I also tried the reflection trick and that doesn't work either. Any pointers would be gratefully received.
In case anyone else is interested in doing this, I managed to do this with some simple Swing:
SchemeConsole console = consoleView.getConsole();
JComponent component = consoleView.getComponent();
Container parent = component.getParent();
parent.add(console.getHistoryViewer().getComponent());
parent.remove(component);
if (parent instanceof JPanel)
{
((JPanel) parent).updateUI();
}
Basically, I find the panel holding the console view component, and swap it out with just the history view component.