GuiInPort.java 532 B

123456789101112131415161718192021222324252627
  1. package kawa;
  2. import java.io.Reader;
  3. import gnu.kawa.io.OutPort;
  4. import gnu.kawa.io.Path;
  5. import gnu.kawa.io.TtyInPort;
  6. import gnu.mapping.*;
  7. /** A TtyInPort that reads from a ReplPane.
  8. */
  9. class GuiInPort extends TtyInPort
  10. {
  11. ReplDocument document;
  12. public GuiInPort (Reader in, Path path, OutPort tie, ReplDocument document)
  13. {
  14. super (in, path, tie);
  15. this.document = document;
  16. }
  17. public void emitPrompt (String prompt) throws java.io.IOException
  18. {
  19. document.write(prompt, ReplDocument.promptStyle);
  20. }
  21. }