2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.view;
19
20 import javax.faces.context.FacesContext;
21 import org.apache.shale.view.faces.FacesConstants;
22
23
24 /***
25 * <p>{@link AbstractViewController} is a convenience base implementation of
26 * {@link ViewController}. It also provides convenience methods inherited
27 * from {@link AbstractFacesBean} to all of its subclasses.</p>
28 *
29 * $Id: AbstractViewController.java 478339 2006-11-22 22:03:44Z craigmcc $
30 */
31
32 public abstract class AbstractViewController extends AbstractFacesBean
33 implements ViewController {
34
35
36
37
38
39 /***
40 * <p>Pre-initialize the <code>postBack</code> property appropriately
41 * if we can.</p>
42 */
43 public AbstractViewController() {
44
45 FacesContext context = FacesContext.getCurrentInstance();
46 if ((context != null)
47 && context.getExternalContext().getRequestMap().containsKey(FacesConstants.VIEW_POSTBACK)) {
48 setPostBack(true);
49 }
50
51 }
52
53
54
55
56
57
58 /***
59 * <p>Flag indicating that this is a postback request.</p>
60 */
61 private boolean postBack = false;
62
63
64 /*** {@inheritDoc} */
65 public boolean isPostBack() {
66
67 return this.postBack;
68
69 }
70
71
72 /*** {@inheritDoc} */
73 public void setPostBack(boolean postBack) {
74
75 this.postBack = postBack;
76
77 }
78
79
80
81
82
83 /***
84 * <p>The default implementation does nothing.</p>
85 */
86 public void destroy() {
87
88 }
89
90
91 /***
92 * <p>The default implementation does nothing.</p>
93 */
94 public void init() {
95
96 }
97
98
99 /***
100 * <p>The default implementation does nothing.</p>
101 */
102 public void preprocess() {
103
104 }
105
106
107 /***
108 * <p>The default implementation does nothing.</p>
109 */
110 public void prerender() {
111
112 }
113
114
115 }