|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Shell
| Method Summary | |
|---|---|
void |
clear()
Clear the console. |
void |
clearLine()
Clear the current line of any text. |
void |
cursorLeft(int x)
Move the cursor x the specified number of positions. |
void |
execute(File file)
Execute a shell script from the specified file. |
void |
execute(File file,
String... args)
Execute a shell script from the specified file, passing the given arguments as input. |
void |
execute(String command)
Execute a shell command. |
DirectoryResource |
getConfigDir()
Return the file-system directory currently in use as the configuration directory. |
DirectoryResource |
getCurrentDirectory()
Return the current working directory resource of the shell. |
Project |
getCurrentProject()
Return the Project on which this shell instance is currently operating. |
Resource<?> |
getCurrentResource()
Return the current working Resource of the shell. |
Class<? extends Resource<?>> |
getCurrentResourceScope()
Return the type of the Resource on which the Shell is currently operating. |
ForgeEnvironment |
getEnvironment()
Get the current Forge environment. |
int |
getHeight()
Return the current height, in characters, of the current shell console. |
String |
getPrompt()
Return the current shell prompt; |
int |
getWidth()
Return the current width, in characters, of the current shell console. |
boolean |
isAnsiSupported()
Returns whether or not this shell supports ANSI escape codes. |
boolean |
isExecuting()
Return true if the Shell is currently executing a plugin; otherwise, return false. |
boolean |
isPretend()
Return true if this shell is currently running in pretend mode. |
boolean |
isVerbose()
Return true if this shell is currently running in verbose mode. |
void |
printlnVerbose(ShellColor color,
String output)
Write color output to the console, only if isVerbose() == true. |
void |
printlnVerbose(String output)
Write output to the console, only if isVerbose() == true. |
String |
readLine()
Ask the current InputStream for data. |
String |
readLine(Character mask)
Ask the current InputStream for input, masking keystrokes in the console with the given mask. |
int |
scan()
Wait for input. |
void |
setAnsiSupported(boolean value)
Controls the shell's usage of ANSI escape code support. |
void |
setCurrentResource(Resource<?> resource)
Set the Resource on which the shell should operate. |
void |
setDefaultPrompt()
Reset the shell prompt to default. |
void |
setInputStream(InputStream inputStream)
Set the stream from which the shell should read input. |
void |
setOutputStream(OutputStream stream)
Set the stream to which the shell should print output. |
void |
setPrompt(String string)
Set the current shell prompt, followed by '> '. |
void |
setVerbose(boolean verbose)
Toggle verbose mode. |
| Methods inherited from interface org.jboss.forge.shell.ShellPrintWriter |
|---|
print, print, println, println, println, renderColor, write |
| Methods inherited from interface org.jboss.forge.shell.ShellPrompt |
|---|
prompt, prompt, prompt, prompt, promptAndSwallowCR, promptBoolean, promptBoolean, promptChoice, promptChoice, promptChoice, promptChoiceTyped, promptChoiceTyped, promptCommon, promptCommon, promptCompleter, promptEnum, promptEnum, promptFile, promptFile, promptRegex, promptRegex, promptSecret |
| Methods inherited from interface org.jboss.forge.shell.ShellHistory |
|---|
setHistory, setHistoryOutputStream, writeToHistory |
| Method Detail |
|---|
DirectoryResource getCurrentDirectory()
getCurrentResource() and move up
the hierarchy until a DirectoryResource is found. (This value may change through execution of plug-ins or
other operations.)
Resource<?> getCurrentResource()
Resource of the shell. (This value may change through execution of plug-ins or
other operations.)
TODO implement ResourceBag for multiple resources
Class<? extends Resource<?>> getCurrentResourceScope()
Resource on which the Shell is currently operating.
RequiresResource}void setCurrentResource(Resource<?> resource)
Resource on which the shell should operate.
Note: This may change the current getCurrentDirectory()
DirectoryResource getConfigDir()
Project getCurrentProject()
Project on which this shell instance is currently operating.
boolean isPretend()
boolean isVerbose()
void setVerbose(boolean verbose)
void printlnVerbose(String output)
isVerbose() == true.
void printlnVerbose(ShellColor color,
String output)
isVerbose() == true.
void clear()
void execute(String command)
void execute(File file)
throws IOException
IOException
void execute(File file,
String... args)
throws IOException
IOExceptionboolean isExecuting()
Shell is currently executing a plugin; otherwise, return false.
int scan()
void clearLine()
void cursorLeft(int x)
void setDefaultPrompt()
void setPrompt(String string)
String getPrompt()
void setInputStream(InputStream inputStream)
throws IOException
IOException
void setOutputStream(OutputStream stream)
throws IOException
IOExceptionint getHeight()
int getWidth()
String readLine()
throws IOException
InputStream for data.
IOException - on error
String readLine(Character mask)
throws IOException
InputStream for input, masking keystrokes in the console with the given mask.
mask - The character to use for masking input
IOException - on errorvoid setAnsiSupported(boolean value)
boolean isAnsiSupported()
ForgeEnvironment getEnvironment()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||