Package org.qdl_lang.gui
Class SwingTerminal
- java.lang.Object
-
- org.qdl_lang.gui.SwingTerminal
-
- All Implemented Interfaces:
TerminalInterface
- Direct Known Subclasses:
QDLSASTerminal
public class SwingTerminal extends Object implements TerminalInterface
Created by Jeff Gaynor
on 8/9/22 at 7:12 AM
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSwingTerminal.QDLHistoryKeyAdapterThis listens for ctrl+up or down arrows and will scroll through the input/outputs in tandem
-
Field Summary
Fields Modifier and Type Field Description protected JFrameframeprotected static StringsyntaxEditStyle
-
Constructor Summary
Constructors Constructor Description SwingTerminal()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JComponent$$$getRootComponent$$$()voidclearCurrentLine()Map<String,String>getCharMap()StringBuffergetCurrentLine()org.fife.ui.rsyntaxtextarea.RSyntaxTextAreagetInput()JPanelgetMainPanel()JTextAreagetOutput()JPanelgetPanel1()JLabelgetPrompt()QDLSwingIOgetQdlSwingIO()StringgetResultText()WorkspaceCommandsgetWorkspaceCommands()protected voidinit()Initialize this with internal state, such as the listeners andDataforQDLSwingIO.static voidmain(String[] args)protected voidrunQDL()voidsetPrompt(String text)voidsetResultText(String x)org.fife.ui.autocomplete.DefaultCompletionProvidersetup(JFrame frame1, List<String> functions)protected voidsetupListeners()This is called in thesetup(JFrame, List)method.protected voidsetupWS(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)Sets up this terminal to run QDL.voidsetWorkspaceCommands(WorkspaceCommands workspaceCommands)protected voidshowHelp(String title, String message)Show's help for the selected area.voidshutdown()
-
-
-
Method Detail
-
getMainPanel
public JPanel getMainPanel()
-
getPanel1
public JPanel getPanel1()
-
getInput
public org.fife.ui.rsyntaxtextarea.RSyntaxTextArea getInput()
-
getOutput
public JTextArea getOutput()
-
getPrompt
public JLabel getPrompt()
-
setPrompt
public void setPrompt(String text)
- Specified by:
setPromptin interfaceTerminalInterface
-
getCurrentLine
public StringBuffer getCurrentLine()
- Specified by:
getCurrentLinein interfaceTerminalInterface
-
clearCurrentLine
public void clearCurrentLine()
- Specified by:
clearCurrentLinein interfaceTerminalInterface
-
setupListeners
protected void setupListeners()
This is called in thesetup(JFrame, List)method. Override as needed.
-
init
protected void init()
Initialize this with internal state, such as the listeners andDataforQDLSwingIO. Should be called in constructor.
-
$$$getRootComponent$$$
public JComponent $$$getRootComponent$$$()
-
showHelp
protected void showHelp(String title, String message)
Show's help for the selected area. Note that this allows for editing and copy paste to the main window (standard Swing dialog does not)- Parameters:
title-message-
-
setResultText
public void setResultText(String x)
- Specified by:
setResultTextin interfaceTerminalInterface
-
getResultText
public String getResultText()
- Specified by:
getResultTextin interfaceTerminalInterface
-
getQdlSwingIO
public QDLSwingIO getQdlSwingIO()
-
getCharMap
public Map<String,String> getCharMap()
- Specified by:
getCharMapin interfaceTerminalInterface
-
setup
public org.fife.ui.autocomplete.DefaultCompletionProvider setup(JFrame frame1, List<String> functions)
-
setupWS
protected void setupWS(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws ThrowableSets up this terminal to run QDL.- Throws:
Throwable
-
getWorkspaceCommands
public WorkspaceCommands getWorkspaceCommands()
-
setWorkspaceCommands
public void setWorkspaceCommands(WorkspaceCommands workspaceCommands)
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceTerminalInterface
-
-