1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.localization.wiki.internal; |
21 |
|
|
22 |
|
import org.xwiki.bridge.event.WikiDeletedEvent; |
23 |
|
import org.xwiki.component.descriptor.ComponentDescriptor; |
24 |
|
import org.xwiki.component.manager.ComponentLookupException; |
25 |
|
import org.xwiki.component.manager.ComponentManager; |
26 |
|
import org.xwiki.localization.TranslationBundle; |
27 |
|
import org.xwiki.localization.message.TranslationMessageParser; |
28 |
|
import org.xwiki.model.reference.DocumentReference; |
29 |
|
import org.xwiki.observation.event.Event; |
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
@see |
35 |
|
@version |
36 |
|
@since |
37 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (9) |
Complexity: 3 |
Complexity Density: 0.6 |
|
38 |
|
public class ComponentDocumentTranslationBundle extends AbstractDocumentTranslationBundle |
39 |
|
{ |
40 |
|
private ComponentDescriptor<TranslationBundle> descriptor; |
41 |
|
|
42 |
|
|
43 |
|
@param |
44 |
|
@param |
45 |
|
@param |
46 |
|
@param |
47 |
|
@param |
48 |
|
@throws |
49 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
50 |
127 |
public ComponentDocumentTranslationBundle(String idPrefix, DocumentReference documentReference,... |
51 |
|
ComponentManager componentManager, TranslationMessageParser translationMessageParser, |
52 |
|
ComponentDescriptor<TranslationBundle> descriptor) throws ComponentLookupException |
53 |
|
{ |
54 |
127 |
super(idPrefix, documentReference, componentManager, translationMessageParser); |
55 |
|
|
56 |
127 |
this.descriptor = descriptor; |
57 |
|
} |
58 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
59 |
41 |
@Override... |
60 |
|
public void onEvent(Event event, Object source, Object data) |
61 |
|
{ |
62 |
41 |
super.onEvent(event, source, data); |
63 |
|
|
64 |
41 |
if (event instanceof WikiDeletedEvent) { |
65 |
|
|
66 |
|
|
67 |
5 |
this.componentManager.unregisterComponent(this.descriptor); |
68 |
|
} |
69 |
|
} |
70 |
|
} |