1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.uiextension.internal; |
21 |
|
|
22 |
|
import java.util.ArrayList; |
23 |
|
import java.util.HashMap; |
24 |
|
import java.util.List; |
25 |
|
import java.util.Map; |
26 |
|
|
27 |
|
import javax.inject.Named; |
28 |
|
import javax.inject.Singleton; |
29 |
|
|
30 |
|
import org.xwiki.component.annotation.Component; |
31 |
|
import org.xwiki.rendering.block.Block; |
32 |
|
import org.xwiki.rendering.block.CompositeBlock; |
33 |
|
import org.xwiki.rendering.block.WordBlock; |
34 |
|
import org.xwiki.uiextension.UIExtension; |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
@version |
40 |
|
@since |
41 |
|
|
42 |
|
@Component |
43 |
|
@Named("helloWorld") |
44 |
|
@Singleton |
|
|
| 83.3% |
Uncovered Elements: 2 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
45 |
|
public class HelloWorldUIExtension implements UIExtension |
46 |
|
{ |
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
47 |
0 |
@Override... |
48 |
|
public String getId() |
49 |
|
{ |
50 |
0 |
return "my extension"; |
51 |
|
} |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
53 |
80 |
@Override... |
54 |
|
public String getExtensionPointId() |
55 |
|
{ |
56 |
80 |
return "hello"; |
57 |
|
} |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
59 |
6 |
@Override... |
60 |
|
public Map<String, String> getParameters() |
61 |
|
{ |
62 |
6 |
Map<String, String> parameters = new HashMap<String, String>(); |
63 |
6 |
parameters.put("HelloWorldKey", "HelloWorldValue"); |
64 |
6 |
return parameters; |
65 |
|
} |
66 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
67 |
2 |
@Override... |
68 |
|
public Block execute() |
69 |
|
{ |
70 |
2 |
List<Block> blocks = new ArrayList<Block>(); |
71 |
2 |
blocks.add(new WordBlock("HelloWorld")); |
72 |
2 |
return new CompositeBlock(blocks); |
73 |
|
} |
74 |
|
} |