java.lang.Object
de.grogra.pf.registry.Plugin
de.grogra.pf.ui.UIApplication
de.grogra.cli.CLIApplication
- All Implemented Interfaces:
RegistryContext
,Command
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Possible states in which the current readline operation may be in. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ReentrantLock
static final I18NBundle
protected CLIApplication.State
Fields inherited from class de.grogra.pf.ui.UIApplication
pm, selected, ui, wbm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if the thread is allowed to readlines for requesting values in the terminal Only the commands that blocks the terminal should be allowed to write valuevoid
Close a workbench and deregister (disconnect) its project.static void
void
Create a new workbench with a new project.void
void
exit()
exit the applicationvoid
flush()
Returns a name which can be used in the graphical user interface to represent this command.Get the last selected workbench by the applicationstatic CLIApplication
org.jline.reader.Completer
boolean
void
listExamples
(Object info) void
listProjects
(Object info) print the list of currently opened projects by the application.void
listTemplates
(Object info) void
listWorkbenches
(Object info) print the list of currently opened workbenches by the application.void
loadExample
(Object info) void
loadExample
(Object info, Command afterCommand) open
(FilterSource fs, Map initParams) Open a project in a new workbench.void
void
void
void
static void
run
(Application app) void
Performs the actions of this command.static void
static void
runXLConsole
(Item item, Object info, Context ctx) protected void
selectWorkbench
(Object info) Set a workbench as selected (i.e. current) from its id.void
setFileToEdit
(File f, String n) void
org.jline.reader.Completer
void
setWorkingDirectory
(File workingDirectory) requires a mainworkbenchvoid
protected void
void
stop()
Terminate the application.void
void
updateLoadingPrompt
(String rightPrompt) void
void
Methods inherited from class de.grogra.pf.ui.UIApplication
close, close, create, create, createWB, getMainWorkbench, getProjectManager, getToolkit, getWorkbenchManager, init, listExamples, listProjects, listTemplates, listWorkbenches, loadExample, loadExample, open, open, selectWorkbench, selectWorkbench, setMainWorkbench, stop
Methods inherited from class de.grogra.pf.registry.Plugin
checkConfigure, getI18NBundle, getPluginDescriptor, getRegistry, initialize, shutdown, startup
-
Field Details
-
I18N
-
state
-
allowToWrite
-
-
Constructor Details
-
CLIApplication
public CLIApplication()
-
-
Method Details
-
getInstance
-
getCurrentWorkbench
Description copied from class:UIApplication
Get the last selected workbench by the application- Specified by:
getCurrentWorkbench
in classUIApplication
- Returns:
- The current workbench for this application
-
getCommandName
Description copied from interface:Command
Returns a name which can be used in the graphical user interface to represent this command.- Returns:
- this commands's name
-
getWorkingDirectory
-
setWorkingDirectory
requires a mainworkbench- Parameters:
workingDirectory
-
-
run
-
run
Description copied from interface:Command
Performs the actions of this command. This method is invoked by theJobManager
after the command has been submitted to the job manager by one ofexecute
,runAt
, orrunLater
-methods. The argumentsinfo
andcontext
are the arguments which have been provided as arguments to theJobManager
-methods.- Specified by:
run
in interfaceCommand
- Overrides:
run
in classUIApplication
- Parameters:
arg
- an argumentcontext
- a context
-
startUIApp
protected void startUIApp() -
println
-
print
-
println
-
print
-
flush
public void flush() -
updateLoadingPrompt
-
updatePrompt
public void updatePrompt() -
updateCLICompleters
public void updateCLICompleters() -
setupCompleters
public org.jline.reader.Completer setupCompleters() -
updateReader
public void updateReader() -
setPROMPT
-
setFileToEdit
-
canReadValue
public boolean canReadValue()Check if the thread is allowed to readlines for requesting values in the terminal Only the commands that blocks the terminal should be allowed to write value -
exit
public void exit()exit the application- Specified by:
exit
in classUIApplication
-
getTerminalInput
public Object getTerminalInput() throws org.jline.reader.UserInterruptException, org.jline.reader.EndOfFileException- Throws:
org.jline.reader.UserInterruptException
org.jline.reader.EndOfFileException
-
startConsoleFileEditor
public void startConsoleFileEditor() throws org.jline.reader.UserInterruptException, org.jline.reader.EndOfFileException- Throws:
org.jline.reader.UserInterruptException
org.jline.reader.EndOfFileException
-
open
Open a project in a new workbench.- Parameters:
info
- : A String that is either the absolute path to a project to open, or a relative path using the working directory as base. See more#changeDirectory(Object)
.
-
open
- Specified by:
open
in classUIApplication
-
open
- Specified by:
open
in classUIApplication
-
selectWorkbench
Set a workbench as selected (i.e. current) from its id.- Specified by:
selectWorkbench
in classUIApplication
- Parameters:
info
- : a String that represent the id of the workbench to select (i.e. select as current workbench).
-
listWorkbenches
print the list of currently opened workbenches by the application.- Specified by:
listWorkbenches
in classUIApplication
- Parameters:
info
- : not used -
-
listProjects
print the list of currently opened projects by the application.- Specified by:
listProjects
in classUIApplication
- Parameters:
info
- : not used -
-
runXLConsole
-
close
Close a workbench and deregister (disconnect) its project.- Specified by:
close
in classUIApplication
-
closeWB
-
create
- Throws:
IOException
-
create
Create a new workbench with a new project.- Specified by:
create
in classUIApplication
- Throws:
IOException
-
loadExample
-
loadExample
- Specified by:
loadExample
in classUIApplication
-
listExamples
- Specified by:
listExamples
in classUIApplication
-
listTemplates
- Specified by:
listTemplates
in classUIApplication
-
stop
public void stop()Terminate the application. It closes all opened workbenches managed by its wbm. Close workbenches do not necessarily close the projects.- Specified by:
stop
in classUIApplication
-
getSysFileCompleter
public org.jline.reader.Completer getSysFileCompleter() -
runScript
-
isExecuting
public boolean isExecuting() -
getExecutionLock
-