|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lessvoid.nifty.controls.ConsoleCommands
public class ConsoleCommands
This adds all the nifty command line features to the console control: - command line completion (for all registered commands) - command history - command processing which detects commands and directly calls your registered commands (via the ConsoleCommand interface)
Nested Class Summary | |
---|---|
static interface |
ConsoleCommands.ConsoleCommand
You can implement this interface for individual commands and Nifty will call them when the registered command has been detected. |
Constructor Summary | |
---|---|
ConsoleCommands(Nifty nifty,
Console console)
Create and attach this to the given console. |
Method Summary | |
---|---|
void |
enableCommandCompletion(boolean enabled)
When the command completion is enabled pressing TAB will check for all known commands. |
List<String> |
getRegisteredCommands()
Get all commands that are registered. |
boolean |
keyEvent(NiftyInputEvent inputEvent)
|
void |
registerCommand(String commandText,
ConsoleCommands.ConsoleCommand command)
Register a command for the command completion feature. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConsoleCommands(Nifty nifty, Console console)
console
- Method Detail |
---|
public void enableCommandCompletion(boolean enabled)
enabled
- true when command completion should be enabled and false if notpublic void registerCommand(String commandText, ConsoleCommands.ConsoleCommand command)
command
- the command to make knownpublic List<String> getRegisteredCommands()
public boolean keyEvent(NiftyInputEvent inputEvent)
keyEvent
in interface KeyInputHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |