1
2
3
4
5
6 package net.sf.navigator.displayer;
7
8 import net.sf.navigator.menu.MenuComponent;
9 import net.sf.navigator.menu.PermissionsAdapter;
10
11 import javax.servlet.jsp.JspException;
12 import javax.servlet.jsp.PageContext;
13 import java.io.IOException;
14
15
16 /**
17 *
18 * @author ssayles
19 * @version
20 */
21 public interface MenuDisplayer {
22
23
24 public static final String DEFAULT_CONFIG =
25 "net.sf.navigator.displayer.DisplayerStrings";
26 public static final String _SELF = "_self";
27 public static final String NBSP = " ";
28 public static final String EMPTY = "";
29
30
31
32 public void display(MenuComponent menu) throws JspException, IOException;
33
34 /**
35 * Returns the name of the <code>MenuDisplayer</code>.
36 * @return Value of property name.
37 */
38 public String getName();
39
40 /**
41 * Sets the name of the <code>MenuDisplayer</code>
42 * @param name New value of property name.
43 */
44 public void setName(String name);
45
46 /**
47 * Returns the name of the message resources bundle that contains
48 * display and/or configuration definitions.
49 *
50 * @return Value of property config.
51 */
52 public String getConfig();
53
54 /**
55 * Sets the name of the message resources bundle that contains
56 * display and/or configuration definitions.
57 *
58 * @param config New value of property config.
59 */
60 public void setConfig(String config);
61
62 /**
63 * Returns the target name for any hrefs that may be generated.
64 *
65 * @return the value for target.
66 */
67 public String getTarget();
68
69 /** Setter for property target.
70 * @param target New value of property target.
71 */
72 public void setTarget(String target);
73
74 /**
75 * Lifecycle method that should be called when the <code>MenuDisplayer</code>
76 * is being prepared for use.
77 *
78 * @param pageContext The JSP pageContext to give the displayer access
79 * to any resources it may need.
80 * @param mapping The menu displayer mapping used to embody the xml
81 * definition.
82 */
83 public void init(PageContext pageContext, MenuDisplayerMapping mapping);
84
85 /**
86 * Lifecycle method that should be called when the <code>MenuDisplayer</code>
87 * is done being used.
88 *
89 * @param pageContext The JSP pageContext to give the displayer access
90 * to any resources it may need.
91 */
92 public void end(PageContext pageContext);
93
94 /** Getter for property permissionsAdapter.
95 * @return Value of property permissionsAdapter.
96 */
97 public PermissionsAdapter getPermissionsAdapter();
98
99 /** Setter for property permissionsAdapter.
100 * @param permissionsAdapter New value of property permissionsAdapter.
101 */
102 public void setPermissionsAdapter(PermissionsAdapter permissionsAdapter);
103 }