Class SNTPromptPane

java.lang.Object
sc.fiji.snt.gui.SNTPromptPane
All Implemented Interfaces:
org.scijava.widget.UIComponent<JTextArea>

public abstract class SNTPromptPane extends Object implements org.scijava.widget.UIComponent<JTextArea>
Syntax-highlighted prompt pane for the SNT scripting REPL. Replaces the vanilla JTextArea used by the upstream SciJava PromptPane with an SNTEditorPane (RSyntaxTextArea) so that input benefits from the same highlighting used elsewhere in SNT.

This is a targeted fork of org.scijava.ui.swing.script.PromptPane. The only structural changes are:

  1. The inner TextArea extends JTextArea class is replaced by SNTEditorPane (RSyntaxTextArea already exposes getRowHeight() publicly, so the subclass is unnecessary).
  2. A RTextScrollPane wraps the editor rather than a plain JScrollPane, enabling RSyntaxTextArea-specific rendering.
Author:
Tiago Ferreira
See Also:
  • Constructor Details

    • SNTPromptPane

      public SNTPromptPane(org.scijava.script.ScriptREPL repl, org.scijava.ui.swing.script.VarsPane vars, org.scijava.ui.swing.script.OutputPane output)
  • Method Details

    • quit

      public abstract void quit()
      A callback method which is invoked when the REPL quits.
    • getScrollPane

      public org.fife.ui.rtextarea.RTextScrollPane getScrollPane()
      Returns the RTextScrollPane wrapping this prompt. Used by SNTInterpreterPane instead of creating a new JScrollPane, so that RSyntaxTextArea-specific rendering (e.g. gutter) is preserved.
    • getComponent

      public JTextArea getComponent()
      Specified by:
      getComponent in interface org.scijava.widget.UIComponent<JTextArea>
    • getComponentType

      public Class<JTextArea> getComponentType()
      Specified by:
      getComponentType in interface org.scijava.widget.UIComponent<JTextArea>