A method getCommandNames() added. This is necessary to be able to find the list of all supported command names. BLD200203200100
authormentlicher@netbeans.org
Tue, 19 Mar 2002 19:37:38 +0000
changeset 2117fcd72edd58bf
parent 2116 3ec3fd3a6913
child 2118 df0d456b1093
A method getCommandNames() added. This is necessary to be able to find the list of all supported command names.
The VcsCommandsProvider will use it.
vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java
     1.1 --- a/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java	Tue Mar 19 18:03:46 2002 +0000
     1.2 +++ b/vcscore/src/org/netbeans/modules/vcscore/VcsFileSystem.java	Tue Mar 19 19:37:38 2002 +0000
     1.3 @@ -3845,6 +3845,19 @@
     1.4          return (VcsCommand) commandsByName.get(name);
     1.5      }
     1.6      
     1.7 +    /**
     1.8 +     * Get the list of all command names.
     1.9 +     * @return The list of all command names.
    1.10 +     */
    1.11 +    public String[] getCommandNames() {
    1.12 +        if (commandsByName == null) {
    1.13 +            Node commands = getCommands();
    1.14 +            if (commands == null) return new String[0];
    1.15 +            setCommands (commands);
    1.16 +        }
    1.17 +        return (String[]) commandsByName.keySet().toArray(new String[commandsByName.size()]);
    1.18 +    }
    1.19 +    
    1.20      private void addCmdActionsToSupporter() {
    1.21          for (Iterator it = commandsByName.values().iterator(); it.hasNext(); ) {
    1.22              VcsCommand cmd = (VcsCommand) it.next();