Package sc.fiji.snt.gui
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:
- The inner
TextArea extends JTextAreaclass is replaced bySNTEditorPane(RSyntaxTextAreaalready exposesgetRowHeight()publicly, so the subclass is unnecessary). - A
RTextScrollPanewraps the editor rather than a plainJScrollPane, enabling RSyntaxTextArea-specific rendering.
- Author:
- Tiago Ferreira
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSNTPromptPane(org.scijava.script.ScriptREPL repl, org.scijava.ui.swing.script.VarsPane vars, org.scijava.ui.swing.script.OutputPane output) -
Method Summary
Modifier and TypeMethodDescriptionorg.fife.ui.rtextarea.RTextScrollPaneReturns theRTextScrollPanewrapping this prompt.abstract voidquit()A callback method which is invoked when the REPL quits.
-
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 theRTextScrollPanewrapping this prompt. Used bySNTInterpreterPaneinstead of creating a newJScrollPane, so that RSyntaxTextArea-specific rendering (e.g. gutter) is preserved. -
getComponent
- Specified by:
getComponentin interfaceorg.scijava.widget.UIComponent<JTextArea>
-
getComponentType
- Specified by:
getComponentTypein interfaceorg.scijava.widget.UIComponent<JTextArea>
-