KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > webwork > config_browser > ActionNamesAction


1 package com.opensymphony.webwork.config_browser;
2
3 import com.opensymphony.xwork.ActionSupport;
4 import com.opensymphony.xwork.config.entities.ActionConfig;
5 import org.apache.commons.logging.Log;
6 import org.apache.commons.logging.LogFactory;
7
8 import java.util.Set JavaDoc;
9 import java.util.TreeSet JavaDoc;
10
11 /**
12  * ActionNamesAction
13  *
14  * @author Jason Carreira Created Aug 11, 2003 9:35:15 PM
15  */

16 public class ActionNamesAction extends ActionSupport {
17     private Set JavaDoc actionNames;
18     private String JavaDoc namespace = "";
19     private Set JavaDoc namespaces;
20     private static Log log = LogFactory.getLog(ActionNamesAction.class);
21
22     public Set JavaDoc getActionNames() {
23         return actionNames;
24     }
25
26     public String JavaDoc getNamespace() {
27         return namespace;
28     }
29
30     public void setNamespace(String JavaDoc namespace) {
31         this.namespace = namespace;
32     }
33
34     public ActionConfig getConfig(String JavaDoc actionName) {
35         return ConfigurationHelper.getActionConfig(namespace, actionName);
36     }
37
38     public Set JavaDoc getNamespaces() {
39         return namespaces;
40     }
41
42     public String JavaDoc execute() throws Exception JavaDoc {
43         namespaces = ConfigurationHelper.getNamespaces();
44         if (namespaces.size() == 0) {
45             addActionError("There are no namespaces in this configuration");
46             return ERROR;
47         }
48         if (namespace == null) {
49             namespace = "";
50         }
51         actionNames =
52                 new TreeSet JavaDoc(ConfigurationHelper.getActionNames(namespace));
53         return SUCCESS;
54     }
55 }
56
Popular Tags