DoRTextDrawElement.java
1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.aemds.guide.addon.dor.DoRUtils
* com.adobe.xfa.Element
* com.adobe.xfa.Node
* com.adobe.xfa.content.Content
* com.adobe.xfa.template.Value
*/
package com.adobe.aemds.guide.addon.dor.elements;
import com.adobe.aemds.guide.addon.dor.DoRUtils;
import com.adobe.aemds.guide.addon.dor.elements.DoRElement;
import com.adobe.xfa.Element;
import com.adobe.xfa.Node;
import com.adobe.xfa.content.Content;
import com.adobe.xfa.template.Value;
import java.util.Properties;
public class DoRTextDrawElement
extends DoRElement {
public DoRTextDrawElement(Element xfaElement) throws Exception {
super(xfaElement);
}
protected String massageText(String text) {
return DoRUtils.convertToPlainText((String)text);
}
@Override
public void applyProperties(Properties properties) throws Exception {
if (!properties.containsKey("_value")) {
properties.put("_value", "");
}
Value valueNode = (Value)this.xfaElement.resolveNode("#value");
DoRUtils.enableRichText((Value)valueNode);
if (properties.containsKey("_value")) {
String text = properties.getProperty("_value");
text = this.massageText(text);
DoRUtils.setValue((Content)((Content)valueNode.getOneOfChild()), (String)text, (String)"text/html");
properties.remove("_value");
}
super.applyProperties(properties, true);
}
}