001    // GraphLab Project: http://graphlab.sharif.edu
002    // Copyright (C) 2008 Mathematical Science Department of Sharif University of Technology
003    // Distributed under the terms of the GNU General Public License (GPL): http://www.gnu.org/licenses/
004    
005    package graphlab.ui;
006    
007    import graphlab.platform.extension.Extension;
008    import graphlab.platform.lang.CommandAttitude;
009    
010    import java.util.HashMap;
011    import java.util.Vector;
012    
013    public class ExtensionShellCommandProvider {
014        public AbstractExtensionAction ths;
015        public Extension trgClass;
016        public CommandAttitude comati;
017        public String abrv;
018        public String command;
019        public String desc;
020        public String help;
021        public static HashMap<String, ExtensionShellCommandProvider> commandsDict = new HashMap<String, ExtensionShellCommandProvider>();
022        public static Vector<ExtensionShellCommandProvider> commands = new Vector<ExtensionShellCommandProvider>();
023        public String name;
024    
025        public ExtensionShellCommandProvider(AbstractExtensionAction ths, Extension trgClass, String name, String abrv, String command, String desc, String help) {
026            this.ths = ths;
027            this.trgClass = trgClass;
028            this.name = name;
029            this.abrv = abrv;
030            this.command = command;
031            this.desc = desc;
032            this.help = help;
033        }
034    
035    
036        public static void addCommand(AbstractExtensionAction ths, Extension trg, String name, String abrv, String command, String desc, String help) {
037            ExtensionShellCommandProvider c = new ExtensionShellCommandProvider(ths, trg, name, abrv, command, desc, help);
038            commands.add(c);
039            commandsDict.put(name, c);
040        }
041    }