Search in sources :

Example 1 with TabCompleteHandle

use of com.bencodez.advancedcore.api.command.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() {
        }
    });
    ArrayList<String> topVoter = new ArrayList<String>();
    for (TopVoter top : TopVoter.values()) {
        topVoter.add(top.toString());
    }
    TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(topvoter)", topVoter) {

        @Override
        public void reload() {
            ArrayList<String> topVoter = new ArrayList<String>();
            for (TopVoter top : TopVoter.values()) {
                topVoter.add(top.toString());
            }
            setReplace(topVoter);
        }

        @Override
        public void updateReplacements() {
        }
    });
    TabCompleteHandler.getInstance().addTabCompleteOption(new TabCompleteHandle("(VoteShop)", sites) {

        @Override
        public void reload() {
            ArrayList<String> sites = new ArrayList<String>();
            for (String str : plugin.getGui().getChestShopIdentifiers()) {
                sites.add(str);
            }
            setReplace(sites);
        }

        @Override
        public void updateReplacements() {
        }
    });
}
Also used : VoteSite(com.bencodez.votingplugin.objects.VoteSite) VoteURLVoteSite(com.bencodez.votingplugin.commands.gui.player.VoteURLVoteSite) TopVoter(com.bencodez.votingplugin.topvoter.TopVoter) VoteTopVoter(com.bencodez.votingplugin.commands.gui.player.VoteTopVoter) ArrayList(java.util.ArrayList) TabCompleteHandle(com.bencodez.advancedcore.api.command.TabCompleteHandle)

Aggregations

TabCompleteHandle (com.bencodez.advancedcore.api.command.TabCompleteHandle)1 VoteTopVoter (com.bencodez.votingplugin.commands.gui.player.VoteTopVoter)1 VoteURLVoteSite (com.bencodez.votingplugin.commands.gui.player.VoteURLVoteSite)1 VoteSite (com.bencodez.votingplugin.objects.VoteSite)1 TopVoter (com.bencodez.votingplugin.topvoter.TopVoter)1 ArrayList (java.util.ArrayList)1