Package net.aufdemrand.denizen.utilities.command

Examples of net.aufdemrand.denizen.utilities.command.Paginator


            Messaging.send(sender, "<b>Example: /denizen listener --report \"Journey 1\"");
            Messaging.send(sender, "");
            return;
        }

        Paginator paginator = new Paginator();
        paginator.header("Active quest listeners for " + player.getName() + ":");
        paginator.addLine("<e>Key: <a>Type  <b>ID");

        if (listeners == null || listeners.isEmpty())
            paginator.addLine("None.");
        else for (AbstractListener quest : listeners.values())
            paginator.addLine("<a>" + quest.getListenerType() + "  <b>" + quest.getListenerId());

        paginator.sendPage(sender, args.getInteger(1, 1));

    }
View Full Code Here


        String type = null;   if (args.hasValueFlag("type"))   type = args.getFlag("type");
        String filter = null; if (args.hasValueFlag("filter")) filter = args.getFlag("filter");
        // Get script names from the scripts.yml in memory
        Set<String> scripts = ScriptRegistry._getScriptNames();
        // New Paginator to display script names
        Paginator paginator = new Paginator().header("Scripts");
        paginator.addLine("<e>Key: <a>Type  <b>Name");
        // Add scripts to Paginator
        for (String script : scripts) {
            ScriptContainer scriptContainer = ScriptRegistry.getScriptContainer(script);
            // If a --type has been specified...
            if (type != null) {
                if (scriptContainer.getContainerType().equalsIgnoreCase(type))
                    if (filter != null) {
                        if (script.contains(filter.toUpperCase()))
                            paginator.addLine("<a>" + scriptContainer.getContainerType().substring(0, 3) + "  <b>" + script);
                    }
                    else paginator.addLine("<a>" + scriptContainer.getContainerType().substring(0, 3) + "  <b>" + script);
                // If a --filter has been specified...
            } else if (filter != null) {
                if (script.contains(filter.toUpperCase()))
                    paginator.addLine("<a>" + scriptContainer.getContainerType().substring(0, 3) + "  <b>" + script);
            } else paginator.addLine("<a>" + scriptContainer.getContainerType().substring(0, 3) + "  <b>" + script);
        }
        // Send the contents of the Paginator to the Player (or Console)
        if (!paginator.sendPage(sender, args.getInteger(1, 1)))
            throw new CommandException("The page " + args.getInteger(1, 1) + " does not exist.");
    }
View Full Code Here

TOP

Related Classes of net.aufdemrand.denizen.utilities.command.Paginator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.