1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.edit.internal; |
21 |
|
|
22 |
|
import javax.inject.Inject; |
23 |
|
import javax.inject.Named; |
24 |
|
import javax.inject.Singleton; |
25 |
|
|
26 |
|
import org.xwiki.bridge.DocumentAccessBridge; |
27 |
|
import org.xwiki.component.annotation.Component; |
28 |
|
import org.xwiki.model.reference.DocumentReference; |
29 |
|
import org.xwiki.model.reference.SpaceReference; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
@version |
35 |
|
@since |
36 |
|
|
37 |
|
@Component |
38 |
|
@Named("editorBindings/space") |
39 |
|
@Singleton |
|
|
| 75% |
Uncovered Elements: 4 (16) |
Complexity: 5 |
Complexity Density: 0.56 |
|
40 |
|
public class SpaceEditorBindingsSource extends AbstractEditorBindingsSource |
41 |
|
{ |
42 |
|
@Inject |
43 |
|
private DocumentAccessBridge documentAccessBridge; |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
204 |
@Override... |
46 |
|
protected String getCacheId() |
47 |
|
{ |
48 |
204 |
return "configuration.editorBindings.space"; |
49 |
|
} |
50 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
51 |
586 |
@Override... |
52 |
|
protected String getCacheKeyPrefix() |
53 |
|
{ |
54 |
586 |
DocumentReference currentDocumentReference = this.documentAccessBridge.getCurrentDocumentReference(); |
55 |
586 |
if (currentDocumentReference != null) { |
56 |
586 |
return this.referenceSerializer.serialize(currentDocumentReference.getParent()); |
57 |
|
} |
58 |
0 |
return null; |
59 |
|
} |
60 |
|
|
|
|
| 66.7% |
Uncovered Elements: 2 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
61 |
164 |
@Override... |
62 |
|
protected DocumentReference getDocumentReference() |
63 |
|
{ |
64 |
164 |
DocumentReference currentDocumentReference = this.documentAccessBridge.getCurrentDocumentReference(); |
65 |
164 |
if (currentDocumentReference != null) { |
66 |
164 |
return new DocumentReference("WebPreferences", (SpaceReference) currentDocumentReference.getParent()); |
67 |
|
} |
68 |
0 |
return null; |
69 |
|
} |
70 |
|
} |