1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.primefaces.extensions.component.head;
23
24 import javax.faces.component.UIOutput;
25
26
27
28
29
30
31
32
33 public class ExtHead extends UIOutput {
34
35 public static final String COMPONENT_TYPE = "org.primefaces.extensions.component.Head";
36 public static final String COMPONENT_FAMILY = "org.primefaces.extensions.component";
37 private static final String DEFAULT_RENDERER = "org.primefaces.extensions.component.HeadRenderer";
38
39
40
41
42
43
44
45 @SuppressWarnings("java:S115")
46 protected enum PropertyKeys {
47
48 title, shortcutIcon;
49
50 private String toString;
51
52 PropertyKeys(final String toString) {
53 this.toString = toString;
54 }
55
56 PropertyKeys() {
57 }
58
59 @Override
60 public String toString() {
61 return toString != null ? toString : super.toString();
62 }
63 }
64
65 public ExtHead() {
66 setRendererType(DEFAULT_RENDERER);
67 }
68
69 @Override
70 public String getFamily() {
71 return COMPONENT_FAMILY;
72 }
73
74 public String getTitle() {
75 return (String) getStateHelper().eval(PropertyKeys.title, null);
76 }
77
78 public void setTitle(final String title) {
79 getStateHelper().put(PropertyKeys.title, title);
80 }
81
82 public String getShortcutIcon() {
83 return (String) getStateHelper().eval(PropertyKeys.shortcutIcon, null);
84 }
85
86 public void setShortcutIcon(final String shortcutIcon) {
87 getStateHelper().put(PropertyKeys.shortcutIcon, shortcutIcon);
88 }
89
90 }