public class ConsoleCommands extends Object implements de.lessvoid.nifty.screen.KeyInputHandler
Modifier and Type | Class and Description |
---|---|
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 and Description |
---|
ConsoleCommands(de.lessvoid.nifty.Nifty nifty,
Console console)
Create and attach this to the given console.
|
Modifier and Type | Method and Description |
---|---|
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(de.lessvoid.nifty.input.NiftyInputEvent inputEvent) |
void |
registerCommand(String commandText,
ConsoleCommands.ConsoleCommand command)
Register a command for the command completion feature.
|
public ConsoleCommands(de.lessvoid.nifty.Nifty nifty, Console console)
console
- 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(de.lessvoid.nifty.input.NiftyInputEvent inputEvent)
keyEvent
in interface de.lessvoid.nifty.screen.KeyInputHandler
Copyright © 2013. All Rights Reserved.