|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Shell
Specifies the contract for an interactive shell.
Any interactive shell class which implements these methods can be launched by the roo-bootstrap mechanism.
It is envisaged implementations will be provided for JLine initially, with possible implementations for Eclipse in the future.
Field Summary | |
---|---|
static String |
WINDOW_TITLE_SLOT
The slot name to use with flash(Level, String, String) if a caller wishes to modify the window title. |
Method Summary | |
---|---|
boolean |
executeCommand(String line)
Runs the specified command. |
void |
flash(Level level,
String message,
String slot)
Displays a progress notification to the user. |
ExitShellRequest |
getExitShellRequest()
|
File |
getHome()
Returns the home directory of the current running shell instance |
boolean |
isDevelopmentMode()
|
void |
promptLoop()
Presents a console prompt and allows the user to interact with the shell. |
void |
setDevelopmentMode(boolean developmentMode)
Indicates the shell should switch into a lower-level development mode. |
void |
setPromptPath(String path)
Changes the "path" displayed in the shell prompt. |
void |
setPromptPath(String path,
boolean overrideStyle)
|
Methods inherited from interface org.springframework.shell.event.ShellStatusProvider |
---|
addShellStatusListener, getShellStatus, removeShellStatusListener |
Methods inherited from interface org.springframework.shell.core.ShellPromptAccessor |
---|
getShellPrompt |
Field Detail |
---|
static final String WINDOW_TITLE_SLOT
flash(Level, String, String)
if a caller wishes to modify the window title.
This may not be supported by all operating system shells. It is provided on a best-effort basis only.
Method Detail |
---|
void promptLoop()
ExitShellRequest getExitShellRequest()
boolean executeCommand(String line)
line
- to execute (required)
void setDevelopmentMode(boolean developmentMode)
developmentMode
- true if development mode should be enabled, false otherwisevoid flash(Level level, String message, String slot)
An implementation may allow multiple messages to be displayed concurrently. So an implementation can determine when a flash message replaces a previous flash message, callers should allocate a unique "slot" name for their messages. It is suggested the class name of the caller be used. This way a slot will be updated without conflicting with flash message sequences from other slots.
Passing an empty string in as the "message" indicates the slot should be cleared.
An implementation need not necessarily use the level or slot concepts. They are expected to be used in most cases, though.
level
- the importance of the message (cannot be null)message
- to display (cannot be null, but may be empty)slot
- the identification slot for the message (cannot be null or empty)boolean isDevelopmentMode()
void setPromptPath(String path)
path
- to set (can be null or empty; must NOT be formatted in any special way eg ANSI codes)void setPromptPath(String path, boolean overrideStyle)
File getHome()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |