1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.uiextension.internal

File HelloWorldUIExtension.java

 

Coverage histogram

../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

0
8
4
1
74
42
4
0.5
2
4
1

Classes

Class Line # Actions
HelloWorldUIExtension 45 8 0% 4 2
0.833333383.3%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
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    * UI Extension
38    *
39    * @version $Id: dda6736b0c197f3de1ef1981c3209a83fc05e2a6 $
40    * @since 4.2M3
41    */
42    @Component
43    @Named("helloWorld")
44    @Singleton
 
45    public class HelloWorldUIExtension implements UIExtension
46    {
 
47  0 toggle @Override
48    public String getId()
49    {
50  0 return "my extension";
51    }
52   
 
53  80 toggle @Override
54    public String getExtensionPointId()
55    {
56  80 return "hello";
57    }
58   
 
59  6 toggle @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   
 
67  2 toggle @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    }