Search in sources :

Example 1 with TabCompleteHandle

use of com.Ben12345rocks.AdvancedCore.Objects.TabCompleteHandle in project VotingPlugin by Ben12345rocks.

the class CommandLoader method loadTabComplete.

/**
 * Load tab complete.
 */
public void loadTabComplete() {
    ArrayList<String> sites = new ArrayList<String>();
    for (VoteSite site : plugin.getVoteSites()) {
        sites.add(site.getKey());
    }
    TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(Sitename)", sites) {

        @Override
        public void reload() {
            ArrayList<String> sites = new ArrayList<String>();
            for (VoteSite site : plugin.getVoteSites()) {
                sites.add(site.getKey());
            }
            setReplace(sites);
        }

        @Override
        public void updateReplacements() {
        }
    });
}
Also used : VoteSite(com.Ben12345rocks.VotingPlugin.Objects.VoteSite) ArrayList(java.util.ArrayList) TabCompleteHandle(com.Ben12345rocks.AdvancedCore.Objects.TabCompleteHandle)

Aggregations

TabCompleteHandle (com.Ben12345rocks.AdvancedCore.Objects.TabCompleteHandle)1 VoteSite (com.Ben12345rocks.VotingPlugin.Objects.VoteSite)1 ArrayList (java.util.ArrayList)1