1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package com.xpn.xwiki.objects.meta

File TextAreaMetaClass.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

0
27
2
1
91
52
2
0.07
13.5
2
1

Classes

Class Line # Actions
TextAreaMetaClass 42 27 0% 2 0
1.0100%
 

Contributing tests

This file is covered by 19 tests. .

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 com.xpn.xwiki.objects.meta;
21   
22    import javax.inject.Named;
23    import javax.inject.Singleton;
24   
25    import org.xwiki.component.annotation.Component;
26   
27    import com.xpn.xwiki.objects.classes.NumberClass;
28    import com.xpn.xwiki.objects.classes.PropertyClassInterface;
29    import com.xpn.xwiki.objects.classes.StaticListClass;
30    import com.xpn.xwiki.objects.classes.TextAreaClass;
31    import com.xpn.xwiki.objects.classes.TextAreaClass.ContentType;
32    import com.xpn.xwiki.objects.classes.TextAreaClass.EditorType;
33   
34    /**
35    * Defines the meta properties of a text area XClass property.
36    *
37    * @version $Id: 2cfab89b65680d5b3c4399dc6f846593c8bd9897 $
38    */
39    @Component
40    @Named("TextArea")
41    @Singleton
 
42    public class TextAreaMetaClass extends StringMetaClass
43    {
44    /**
45    * Unknown value.
46    */
47    private static final String UNKNWON = "---";
48   
49    /**
50    * Default constructor. Initializes the default meta properties of a Text Area XClass property.
51    */
 
52  95 toggle public TextAreaMetaClass()
53    {
54  95 setPrettyName("TextArea");
55  95 setName(getClass().getAnnotation(Named.class).value());
56   
57  95 NumberClass rowsClass = new NumberClass(this);
58  95 rowsClass.setName("rows");
59  95 rowsClass.setPrettyName("Rows");
60  95 rowsClass.setSize(5);
61  95 rowsClass.setNumberType("integer");
62  95 safeput(rowsClass.getName(), rowsClass);
63   
64  95 StaticListClass editorClass = new StaticListClass(this);
65  95 editorClass.setName("editor");
66  95 editorClass.setPrettyName("Editor");
67  95 editorClass.setValues(UNKNWON + '|' + EditorType.TEXT + '|' + EditorType.PURE_TEXT + '|' + EditorType.WYSIWYG);
68  95 editorClass.setRelationalStorage(false);
69  95 editorClass.setDisplayType("select");
70  95 editorClass.setMultiSelect(false);
71  95 editorClass.setSize(1);
72  95 safeput(editorClass.getName(), editorClass);
73   
74  95 StaticListClass contentTypeClass = new StaticListClass(this);
75  95 contentTypeClass.setName("contenttype");
76  95 contentTypeClass.setPrettyName("Content");
77  95 contentTypeClass.setValues(
78    UNKNWON + '|' + ContentType.WIKI_TEXT + '|' + ContentType.VELOCITY_CODE + '|' + ContentType.PURE_TEXT);
79  95 contentTypeClass.setRelationalStorage(false);
80  95 contentTypeClass.setDisplayType(editorClass.getDisplayType());
81  95 contentTypeClass.setMultiSelect(false);
82  95 contentTypeClass.setSize(1);
83  95 safeput(contentTypeClass.getName(), contentTypeClass);
84    }
85   
 
86  12898 toggle @Override
87    public PropertyClassInterface getInstance()
88    {
89  12898 return new TextAreaClass();
90    }
91    }