1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.widget;
17
18 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
21 import org.kuali.rice.krad.uif.component.Component;
22 import org.kuali.rice.krad.uif.view.View;
23
24
25
26
27
28
29
30
31
32
33
34 @BeanTags(
35 {@BeanTag(name = "tooltip-bean", parent = "Uif-Tooltip"), @BeanTag(name = "tooltipHelp-bean", parent = "Uif-TooltipHelp"),
36 @BeanTag(name = "tooltipFocus-bean", parent = "Uif-TooltipFocus")})
37 public class Tooltip extends WidgetBase {
38
39 private String tooltipContent;
40
41 private boolean onFocus;
42 private boolean onMouseHover;
43
44 public Tooltip() {
45 super();
46 }
47
48
49
50
51
52 @Override
53 public void performFinalize(View view, Object model, Component parent) {
54 super.performFinalize(view, model, parent);
55 }
56
57
58
59
60
61
62 @BeanTagAttribute(name = "tooltipContent")
63 public String getTooltipContent() {
64 return tooltipContent;
65 }
66
67
68
69
70
71
72 public void setTooltipContent(String tooltipContent) {
73 if (tooltipContent != null) {
74 this.tooltipContent = tooltipContent.replace("\"", """).replace("'", "'");
75 } else {
76 this.tooltipContent = null;
77 }
78 }
79
80
81
82
83
84
85 @BeanTagAttribute(name = "onFocus")
86 public boolean isOnFocus() {
87 return onFocus;
88 }
89
90
91
92
93
94
95 public void setOnFocus(boolean onFocus) {
96 this.onFocus = onFocus;
97 }
98
99
100
101
102
103
104 @BeanTagAttribute(name = "onMouseHover")
105 public boolean isOnMouseHover() {
106 return onMouseHover;
107 }
108
109
110
111
112
113
114 public void setOnMouseHover(boolean onMouseHover) {
115 this.onMouseHover = onMouseHover;
116 }
117
118
119
120
121 @Override
122 protected <T> void copyProperties(T component) {
123 super.copyProperties(component);
124 Tooltip tooltipCopy = (Tooltip) component;
125 tooltipCopy.setTooltipContent(this.getTooltipContent());
126 tooltipCopy.setOnFocus(this.isOnFocus());
127 tooltipCopy.setOnMouseHover(this.isOnMouseHover());
128 }
129 }