1 | if (item.getEmailAddress() != null) {↵ | | |
|
2 | buf.append("<br> eMail: "↵ | | |
|
3 | + convert((String) item.getEmailAddress()));↵ | | |
|
4 | }↵ | | |
|
5 | // TODO ↵ | | |
|
6 | // if (item.getWebsite() != null) {↵ | | 1 | if (item.getWebsite() != null) {↵
|
7 | // buf.append("<br> Website: "↵ | | 2 | buf.append("<br> Website: "↵
|
8 | // + convert((String) item.getWebsite()));↵ | | 3 | + convert((String) item.getWebsite()));↵
|
9 | // }↵ | | 4 | }↵
|
10 | buf.append("</body></html>");↵ | | 5 | buf.append("</body></html>");↵
|
|
11 | return buf.toString();↵ | | 6 | return buf.toString();↵
|
12 | }↵ | | 7 | }↵
|
|
13 | public static String createToolTip(IGroupItem item) {↵ | | 8 | public static String createToolTip(GroupModelPartial item) {↵
|
|
14 | StringBuffer buf = new StringBuffer();↵ | | 9 | StringBuffer buf = new StringBuffer();↵
|
|
15 | buf.append("<html><body> Name: " + item.getName());↵ | | 10 | buf.append("<html><body> Name: " + item.getName());↵
|
16 | if (item.getDescription() != null) {↵ | | 11 | if (item.getDescription() != null) {↵
|
17 | buf.append("<br> Description: " + item.getDescription());↵ | | 12 | buf.append("<br> Description: " + item.getDescription());↵
|
18 | }↵ | | 13 | }↵
|
19 | buf.append("</body></html>");↵ | | 14 | buf.append("</body></html>");↵
|
|
20 | return buf.toString();↵ | | 15 | return buf.toString();↵
|
21 | }↵ | | 16 | }↵
|
|
22 | private static String convert(String str) {↵ | | 17 | private static String convert(String str) {↵
|
23 | if (str == null) {↵ | | 18 | if (str == null) {↵
|
24 | return "";↵ | | 19 | return "";↵
|
25 | }↵ | | 20 | }↵
|
|
26 | StringBuffer result = new StringBuffer();↵ | | 21 | StringBuffer result = new StringBuffer();↵
|
27 | int pos = 0;↵ | | 22 | int pos = 0;↵
|
28 | char ch;↵ | | 23 | char ch;↵
|
|
29 | while (pos < str.length()) {↵ | | 24 | while (pos < str.length()) {↵
|
30 | ch = str.charAt(pos);↵ | | 25 | ch = str.charAt(pos);↵
|
|
31 | if (ch == '<') {↵ | | 26 | if (ch == '<') {↵
|
32 | result.append("<");↵ | | 27 | result.append("<");↵
|
33 | } else if (ch == '>') {↵ | | 28 | } else if (ch == '>') {↵
|
34 | result.append(">");↵ | | 29 | result.append(">");↵
|
35 | } else {↵ | | 30 | } else {↵
|
36 | result.append(ch);↵ | | 31 | result.append(ch);↵
|
37 | }↵ | | 32 | }↵
|
|
38 | pos++;↵ | | 33 | pos++;↵
|
39 | }↵ | | 34 | }↵
|
|
40 | return result.toString();↵ | | 35 | return result.toString();↵
|
41 | | | 36 |
|