public class Shell extends ExecutionContext.Native
Modifier and Type | Field and Description |
---|---|
static int |
ALL_STREAMS
All streams constant.
|
static int |
ECHO_STREAM
Echo stream constant.
|
static int |
ERROR_STREAM
Error stream constant.
|
static int |
OUTPUT_STREAM
Output stream constant.
|
static int |
PROMPT_STREAM
Prompt stream constant.
|
static int |
STREAM_TYPES_COUNT
Number of stream types.
|
static int |
WELCOME_STREAM
Welcome stream constant.
|
Constructor and Description |
---|
Shell(Cli CLI_Cli)
Top execution context constructor.
|
Shell(ExecutionContext.Interface CLI_ParentContext,
Cli CLI_Cli)
Child execution context constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
cleanScreen(boolean B_PromptMenu)
Cleans the screen.
|
void |
displayHelp()
Displays help depending on the context of the current line.
|
void |
enterMenu(Menu CLI_Menu,
boolean B_PromptMenu)
Enter a menu.
|
void |
exitMenu(boolean B_PromptMenu)
Exits the current menu.
|
Cli |
getCli()
Cli accessor.
|
Menu |
getCurrentMenu(int I_MenuIndex)
Current menu retrieval.
|
int |
getHelpMargin()
Help margin accessor.
|
int |
getHelpOffset()
Help offset accessor.
|
void |
printWorkingMenu()
Prints the working menu.
|
void |
quit()
Terminates the shell.
|
void |
setByeMessage(ResourceString CLI_ByeMessage)
Bye message setting.
|
void |
setPrompt(ResourceString CLI_Prompt)
Prompt message positionning.
|
void |
setWelcomeMessage(ResourceString CLI_WelcomeMessage)
Welcome message setting.
|
enableStream, getBeep, getInput, getLang, getStream, isRunning, run, run, setBeep, setLang, setStream, stopAllExecutions, stopExecution, streamEnabled, watchResult
createdFromNative, dontFinalize, finalize, forget, getbDoFinalize, getNativeRef, getObject, remember
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNativeRef
public static final int ALL_STREAMS
public static final int WELCOME_STREAM
public static final int PROMPT_STREAM
public static final int ECHO_STREAM
public static final int OUTPUT_STREAM
public static final int ERROR_STREAM
public static final int STREAM_TYPES_COUNT
public Shell(Cli CLI_Cli)
CLI_Cli
- Cli structure the shell will run the text based interface for.public Shell(ExecutionContext.Interface CLI_ParentContext, Cli CLI_Cli)
CLI_ParentContext
- Parent execution context.CLI_Cli
- Cli structure the shell will run the text based interface for.public final Cli getCli()
public final void setWelcomeMessage(ResourceString CLI_WelcomeMessage)
CLI_WelcomeMessage
- Welcome message. When an empty string is given, the default welcome message is restored.public final void setByeMessage(ResourceString CLI_ByeMessage)
CLI_ByeMessage
- Bye message. When an empty string is given, the default bye message is restored.public final void setPrompt(ResourceString CLI_Prompt)
CLI_Prompt
- Prompt string. When an empty string is given, the default prompt (depending on the current menu) is restored.public final int getHelpMargin()
public final int getHelpOffset()
public Menu getCurrentMenu(int I_MenuIndex)
I_MenuIndex
- Index of the menu in the stack.
0: root menu (bottom of the stack).
1: menu stacked over the root menu.
2: menu stacked over again...
-1: current menu (top of the stack)public final void enterMenu(Menu CLI_Menu, boolean B_PromptMenu)
CLI_Menu
- Menu to enter.B_PromptMenu
- true if the menu should be (re)prompted.
Basically false when executed within the context of a command processing,
true when executed from other contexts.public final void exitMenu(boolean B_PromptMenu)
B_PromptMenu
- true if the menu should be (re)prompted.
Basically false when executed within the context of a command processing,
true when executed from other contexts.public final void quit()
public final void displayHelp()
public final void printWorkingMenu()
public final void cleanScreen(boolean B_PromptMenu)
B_PromptMenu
- true if the menu should be (re)prompted.
Basically false when executed within the context of a command processing,
true when executed from other contexts.