public class CommandCompletions<C extends CommandCompletionContext> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
CommandCompletions.AsyncCommandCompletionHandler<C extends CommandCompletionContext> |
static interface |
CommandCompletions.CommandCompletionHandler<C extends CommandCompletionContext> |
static class |
CommandCompletions.SyncCompletionRequired |
| Constructor and Description |
|---|
CommandCompletions(CommandManager manager) |
| Modifier and Type | Method and Description |
|---|---|
CommandCompletions.CommandCompletionHandler |
registerAsyncCompletion(String id,
CommandCompletions.AsyncCommandCompletionHandler<C> handler)
Registr a completion handler to provide command completions based on the user input.
|
CommandCompletions.CommandCompletionHandler |
registerCompletion(String id,
CommandCompletions.CommandCompletionHandler<C> handler)
Registr a completion handler to provide command completions based on the user input.
|
CommandCompletions.CommandCompletionHandler |
registerStaticCompletion(String id,
Collection<String> completions)
Register a static list of command completions that will never change
|
CommandCompletions.CommandCompletionHandler |
registerStaticCompletion(String id,
String list)
Register a static list of command completions that will never change.
|
CommandCompletions.CommandCompletionHandler |
registerStaticCompletion(String id,
String[] completions)
Register a static list of command completions that will never change
|
CommandCompletions.CommandCompletionHandler |
registerStaticCompletion(String id,
Supplier<Collection<String>> supplier)
Register a static list of command completions that will never change.
|
public CommandCompletions(CommandManager manager)
public CommandCompletions.CommandCompletionHandler registerCompletion(String id, CommandCompletions.CommandCompletionHandler<C> handler)
id - handler - public CommandCompletions.CommandCompletionHandler registerAsyncCompletion(String id, CommandCompletions.AsyncCommandCompletionHandler<C> handler)
Not all platforms support this, so if the platform does not support asynchronous execution, your handler will be executed on the main thread.
Use this anytime your handler does not need to access state that is not considered thread safe.
Use context.isAsync() to determine if you are async or not.
id - handler - public CommandCompletions.CommandCompletionHandler registerStaticCompletion(String id, String list)
Example: foo|bar|baz
id - list - public CommandCompletions.CommandCompletionHandler registerStaticCompletion(String id, String[] completions)
id - completions - public CommandCompletions.CommandCompletionHandler registerStaticCompletion(String id, Supplier<Collection<String>> supplier)
id - supplier - public CommandCompletions.CommandCompletionHandler registerStaticCompletion(String id, Collection<String> completions)
id - completions - Copyright © 2019. All rights reserved.