1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.rendering.internal.transformation.icon; |
21 |
|
|
22 |
|
import java.util.Properties; |
23 |
|
|
24 |
|
import javax.inject.Singleton; |
25 |
|
|
26 |
|
import org.xwiki.component.annotation.Component; |
27 |
|
import org.xwiki.component.phase.Initializable; |
28 |
|
import org.xwiki.component.phase.InitializationException; |
29 |
|
import org.xwiki.rendering.transformation.icon.IconTransformationConfiguration; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
37 |
|
@Component |
38 |
|
@Singleton |
|
|
| 91.7% |
Uncovered Elements: 2 (24) |
Complexity: 3 |
Complexity Density: 0.14 |
|
39 |
|
public class DefaultIconTransformationConfiguration implements IconTransformationConfiguration, Initializable |
40 |
|
{ |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
private Properties mappings = new Properties(); |
45 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (17) |
Complexity: 1 |
Complexity Density: 0.06 |
|
46 |
35 |
@Override... |
47 |
|
public void initialize() throws InitializationException |
48 |
|
{ |
49 |
|
|
50 |
35 |
this.mappings.setProperty(":)", "emoticon_smile"); |
51 |
35 |
this.mappings.setProperty(":(", "emoticon_unhappy"); |
52 |
35 |
this.mappings.setProperty(":P", "emoticon_tongue"); |
53 |
35 |
this.mappings.setProperty(":D", "emoticon_grin"); |
54 |
35 |
this.mappings.setProperty(";)", "emoticon_wink"); |
55 |
35 |
this.mappings.setProperty("(y)", "thumb_up"); |
56 |
35 |
this.mappings.setProperty("(n)", "thumb_down"); |
57 |
35 |
this.mappings.setProperty("(i)", "information"); |
58 |
35 |
this.mappings.setProperty("(/)", "accept"); |
59 |
35 |
this.mappings.setProperty("(x)", "cancel"); |
60 |
35 |
this.mappings.setProperty("(!)", "error"); |
61 |
35 |
this.mappings.setProperty("(+)", "add"); |
62 |
35 |
this.mappings.setProperty("(-)", "delete"); |
63 |
35 |
this.mappings.setProperty("(?)", "help"); |
64 |
35 |
this.mappings.setProperty("(on)", "lightbulb"); |
65 |
35 |
this.mappings.setProperty("(off)", "lightbulb_off"); |
66 |
35 |
this.mappings.setProperty("(*)", "star"); |
67 |
|
} |
68 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
69 |
35 |
@Override... |
70 |
|
public Properties getMappings() |
71 |
|
{ |
72 |
35 |
Properties properties = new Properties(); |
73 |
35 |
properties.putAll(this.mappings); |
74 |
35 |
return properties; |
75 |
|
} |
76 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
0 |
@Override... |
78 |
|
public void addMapping(String iconCharacters, String iconName) |
79 |
|
{ |
80 |
0 |
this.mappings.setProperty(iconCharacters, iconName); |
81 |
|
} |
82 |
|
} |