1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
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 |
|
|
36 |
|
|
37 |
|
@version |
38 |
|
|
39 |
|
@Component |
40 |
|
@Named("TextArea") |
41 |
|
@Singleton |
|
|
| 100% |
Uncovered Elements: 0 (29) |
Complexity: 2 |
Complexity Density: 0.07 |
|
42 |
|
public class TextAreaMetaClass extends StringMetaClass |
43 |
|
{ |
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
private static final String UNKNWON = "---"; |
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (26) |
Complexity: 1 |
Complexity Density: 0.04 |
|
52 |
78 |
public TextAreaMetaClass()... |
53 |
|
{ |
54 |
78 |
setPrettyName("TextArea"); |
55 |
78 |
setName(getClass().getAnnotation(Named.class).value()); |
56 |
|
|
57 |
78 |
NumberClass rowsClass = new NumberClass(this); |
58 |
78 |
rowsClass.setName("rows"); |
59 |
78 |
rowsClass.setPrettyName("Rows"); |
60 |
78 |
rowsClass.setSize(5); |
61 |
78 |
rowsClass.setNumberType("integer"); |
62 |
78 |
safeput(rowsClass.getName(), rowsClass); |
63 |
|
|
64 |
78 |
StaticListClass editorClass = new StaticListClass(this); |
65 |
78 |
editorClass.setName("editor"); |
66 |
78 |
editorClass.setPrettyName("Editor"); |
67 |
78 |
editorClass.setValues(UNKNWON + '|' + EditorType.TEXT + '|' + EditorType.PURE_TEXT + '|' + EditorType.WYSIWYG); |
68 |
78 |
editorClass.setRelationalStorage(false); |
69 |
78 |
editorClass.setDisplayType("select"); |
70 |
78 |
editorClass.setMultiSelect(false); |
71 |
78 |
editorClass.setSize(1); |
72 |
78 |
safeput(editorClass.getName(), editorClass); |
73 |
|
|
74 |
78 |
StaticListClass contentTypeClass = new StaticListClass(this); |
75 |
78 |
contentTypeClass.setName("contenttype"); |
76 |
78 |
contentTypeClass.setPrettyName("Content"); |
77 |
78 |
contentTypeClass.setValues( |
78 |
|
UNKNWON + '|' + ContentType.WIKI_TEXT + '|' + ContentType.VELOCITY_CODE + '|' + ContentType.PURE_TEXT); |
79 |
78 |
contentTypeClass.setRelationalStorage(false); |
80 |
78 |
contentTypeClass.setDisplayType(editorClass.getDisplayType()); |
81 |
78 |
contentTypeClass.setMultiSelect(false); |
82 |
78 |
contentTypeClass.setSize(1); |
83 |
78 |
safeput(contentTypeClass.getName(), contentTypeClass); |
84 |
|
} |
85 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
86 |
5386 |
@Override... |
87 |
|
public PropertyClassInterface getInstance() |
88 |
|
{ |
89 |
5386 |
return new TextAreaClass(); |
90 |
|
} |
91 |
|
} |