Package com.alphacsp.cit.commands

Examples of com.alphacsp.cit.commands.CommandsTemplate


        interperter.setEnvironment(environment);

        XmlCommandsReader commandsReader = new XmlCommandsReader();
        commandsReader.setClassLoader(classLoader);
        commandsReader.setXmlFile(new DefaultResource(commandsFileLocation));
        CommandsTemplate groups = commandsReader.readObject();
        interperter.setCommandsTemplate(groups);

        return interperter;
    }
View Full Code Here


        super(new String[0]);
        this.interperter = interperter;
    }

    public int complete(String buffer, int cursor, List candidates) {
        CommandsTemplate commandsTemplate = this.interperter.getCommandsTemplate();
        IndexedMap<String, Command> builtinCommands = this.interperter.getBuiltinCommands();
        IndexedMap<String, Command> commands = commandsTemplate.getDefaultGroup().getCommands();
        TreeSet<String> treeSet = new TreeSet<String>(commands.keyList());
        treeSet.addAll(builtinCommands.keyList());
        treeSet.addAll(commands.keyList());
        setCandidates(treeSet);
        return super.complete(buffer, cursor, candidates);
View Full Code Here

    }

    public Set<String> complete(String part) {
        TreeSet<String> result = new TreeSet<String>();

        CommandsTemplate commandsTemplate = this.interperter.getCommandsTemplate();
        IndexedMap<String, Command> builtinCommands = this.interperter.getBuiltinCommands();

        for (int i = 0; i < builtinCommands.size(); i++) {
            String command = builtinCommands.getKey(i);
            if (command.startsWith(part)) result.add(command);
        }

        IndexedMap<String, Command> commands = commandsTemplate.getDefaultGroup().getCommands();

        for (int i = 0; i < commands.size(); i++) {
            String command = commands.getKey(i);
            if (command.startsWith(part)) result.add(command);
        }
View Full Code Here

TOP

Related Classes of com.alphacsp.cit.commands.CommandsTemplate

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.