1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.edit.script; |
21 |
|
|
22 |
|
import java.util.Map; |
23 |
|
|
24 |
|
import javax.inject.Named; |
25 |
|
import javax.inject.Singleton; |
26 |
|
|
27 |
|
import org.xwiki.component.annotation.Component; |
28 |
|
import org.xwiki.edit.EditException; |
29 |
|
import org.xwiki.edit.Editor; |
30 |
|
import org.xwiki.rendering.syntax.Syntax; |
31 |
|
import org.xwiki.rendering.syntax.SyntaxContent; |
32 |
|
import org.xwiki.stability.Unstable; |
33 |
|
|
34 |
|
|
35 |
|
@link@link |
36 |
|
|
37 |
|
@version |
38 |
|
@since |
39 |
|
|
40 |
|
@Component |
41 |
|
@Singleton |
42 |
|
@Named(EditScriptService.ROLE_HINT + ".syntaxContent") |
43 |
|
@Unstable |
|
|
| 85.7% |
Uncovered Elements: 2 (14) |
Complexity: 6 |
Complexity Density: 1 |
|
44 |
|
public class SyntaxContentEditScriptService extends AbstractTypedEditScriptService<SyntaxContent> |
45 |
|
{ |
46 |
|
|
47 |
|
@return@link |
48 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
49 |
31 |
public Editor<SyntaxContent> getDefaultTextEditor()... |
50 |
|
{ |
51 |
31 |
return getDefaultEditor("text"); |
52 |
|
} |
53 |
|
|
54 |
|
|
55 |
|
@return@link |
56 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
57 |
14 |
public Editor<SyntaxContent> getDefaultWysiwygEditor()... |
58 |
|
{ |
59 |
14 |
return getDefaultEditor("wysiwyg"); |
60 |
|
} |
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
@param |
66 |
|
@param |
67 |
|
@param |
68 |
|
@return@link |
69 |
|
@throws |
70 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
71 |
31 |
public String text(String content, Syntax syntax, Map<String, Object> parameters) throws EditException... |
72 |
|
{ |
73 |
31 |
Editor<SyntaxContent> editor = getDefaultTextEditor(); |
74 |
31 |
return editor == null ? null : editor.render(new SyntaxContent(content, syntax), parameters); |
75 |
|
} |
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
@param |
81 |
|
@param |
82 |
|
@param |
83 |
|
@return@link |
84 |
|
@throws |
85 |
|
|
|
|
| 75% |
Uncovered Elements: 1 (4) |
Complexity: 2 |
Complexity Density: 1 |
|
86 |
14 |
public String wysiwyg(String content, Syntax syntax, Map<String, Object> parameters) throws EditException... |
87 |
|
{ |
88 |
14 |
Editor<SyntaxContent> editor = getDefaultWysiwygEditor(); |
89 |
14 |
return editor == null ? null : editor.render(new SyntaxContent(content, syntax), parameters); |
90 |
|
} |
91 |
|
} |