KeyInputHandlerpublic class ConsoleCommands extends java.lang.Object implements KeyInputHandler
| Modifier and Type | Class | 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 | Description |
|---|---|
ConsoleCommands(Nifty nifty,
Console console) |
Create and attach this to the given console.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
enableCommandCompletion(boolean enabled) |
When the command completion is enabled pressing TAB will check for all known
commands.
|
ConsoleCommands.ConsoleCommand |
findCommand(java.lang.String commandText) |
Find a ConsoleCommand with the given commandText.
|
java.util.List<java.lang.String> |
getRegisteredCommands() |
Get all commands that are registered.
|
boolean |
keyEvent(NiftyInputEvent inputEvent) |
|
void |
registerCommand(java.lang.String commandText,
ConsoleCommands.ConsoleCommand command) |
Register a command for the command completion feature.
|
public void enableCommandCompletion(boolean enabled)
enabled - true when command completion should be enabled and false if notpublic void registerCommand(@Nonnull
java.lang.String commandText,
@Nonnull
ConsoleCommands.ConsoleCommand command)
command - the command to make known@Nonnull public java.util.List<java.lang.String> getRegisteredCommands()
public boolean keyEvent(@Nonnull
NiftyInputEvent inputEvent)
keyEvent in interface KeyInputHandler@Nullable public ConsoleCommands.ConsoleCommand findCommand(@Nonnull java.lang.String commandText)
commandText - the command to returnCopyright © 2018. All rights reserved.