1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.myfaces.custom.document;
20
21 import javax.faces.component.UIComponentBase;
22
23 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
24 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
25
26
27
28
29
30
31
32
33
34
35
36 @JSFComponent(
37 tagClass = "org.apache.myfaces.custom.document.AbstractDocumentTag",
38 configExcluded = true)
39 public class AbstractDocument extends UIComponentBase
40 {
41 public static final String COMPONENT_FAMILY = "javax.faces.Data";
42
43 public AbstractDocument(String renderType)
44 {
45 setRendererType(renderType);
46 }
47
48 public String getFamily()
49 {
50 return COMPONENT_FAMILY;
51 }
52
53 public void setState(String state)
54 {
55 getStateHelper().put(PropertyKeys.state, state );
56 }
57
58
59
60
61
62 @JSFProperty(literalOnly = true)
63 public String getState()
64 {
65 return (String)getStateHelper().get(PropertyKeys.state);
66 }
67
68 public boolean hasState()
69 {
70 return isStartState() || isEndState();
71 }
72
73 public boolean isStartState()
74 {
75 return "start".equals(getState());
76 }
77
78 public boolean isEndState()
79 {
80 return "end".equals(getState());
81 }
82
83 protected enum PropertyKeys
84 {
85 state
86 }
87 }