01: package com.jat.presentation.parameter;
02:
03: import java.util.Enumeration;
04: import javax.servlet.http.HttpServletRequest;
05:
06: import com.jat.presentation.controller.Action;
07: import com.jat.presentation.controller.ActionFactory;
08: import com.jat.util.OrderVector;
09: import com.jat.util.StringOrderable;
10:
11: /**
12: * <p>Title: JAT</p>
13: * <p>Description: </p>
14: * <p>Copyright: Copyright (c) 2004 -2005 Stefano Fratini (stefano.fratini@gmail.com)</p>
15: * <p>Distributed under the terms of the GNU Lesser General Public License, v2.1 or later</p>
16: * @author stf
17: * @version 1.0
18: * @since 1.2
19: */
20:
21: public class ActionPageList implements OptionPlugin {
22: public Enumeration list(HttpServletRequest request,
23: String parameterName) {
24: OrderVector ret = new OrderVector();
25: for (Enumeration e = ActionFactory.getDefault().names(); e
26: .hasMoreElements();) {
27: String name = (String) e.nextElement();
28: Action action = ActionFactory.getDefault().getAction(name);
29: StringOrderable page = new StringOrderable(action
30: .getNextPage());
31: if (!ret.contains(page))
32: ret.addAscElement(page);
33: page = new StringOrderable(action.getErrorPage());
34: if (!ret.contains(page))
35: ret.addAscElement(page);
36: }
37: return ret.elements();
38: }
39: }
|