Border.java
3.04 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.template.formatting;
import com.adobe.xfa.AppModel;
import com.adobe.xfa.Attribute;
import com.adobe.xfa.Element;
import com.adobe.xfa.EnumAttr;
import com.adobe.xfa.EnumValue;
import com.adobe.xfa.Model;
import com.adobe.xfa.Node;
import com.adobe.xfa.ProtoableNode;
import com.adobe.xfa.XFA;
import org.xml.sax.Attributes;
public final class Border
extends ProtoableNode {
public Border(Element parent, Node prevSibling) {
super(parent, prevSibling, null, "border", "border", null, XFA.BORDERTAG, "border");
}
@Override
public Attribute defaultAttribute(int eTag) {
if (eTag == XFA.PRESENCETAG && this.isDefault(true)) {
return EnumValue.getEnum(XFA.PRESENCETAG, EnumAttr.getEnum(1076494338));
}
return super.defaultAttribute(eTag);
}
@Override
protected Node defaultElementImpl(int eTag, int nOccurrence, boolean bAppend) {
if (eTag == XFA.SCHEMA_DEFAULTTAG) {
eTag = this.defaultElement();
}
if (eTag == XFA.SCHEMA_DEFAULTTAG) {
return null;
}
Element e = null;
if (nOccurrence == 0) {
String className = XFA.getString(eTag);
Border parent = bAppend ? this : null;
e = this.getModel().createElement(parent, this.getLastXMLChild(), null, className, className, null, 0, null);
} else if (nOccurrence == 1) {
Element source;
e = bAppend ? this.getElement(eTag, false, 0, false, false).clone(this, true) : ((source = this.getElement(eTag, true, 0, false, false)) != null ? source.clone(null, true) : this.getModel().createElement(eTag, null));
} else if (nOccurrence == 2) {
if (bAppend) {
this.getElement(eTag, false, 1, false, false);
e = this.getElement(eTag, false, 0, false, false).clone(this, true);
} else {
Element source = this.getElement(eTag, true, 0, false, false);
e = source != null ? source.clone(null, true) : this.getModel().createElement(eTag, null);
}
} else if (nOccurrence == 3 || this.getAppModel().getLegacySetting(AppModel.XFA_LEGACY_V27_SCRIPTING)) {
if (bAppend) {
this.getElement(eTag, false, 2, false, false);
e = this.getElement(eTag, false, 1, false, false).clone(this, true);
} else {
Element source = this.getElement(eTag, true, 0, false, false);
if (source != null) {
e = source.clone(null, true);
} else {
this.getElement(eTag, false, 1, false, false);
e = this.getElement(eTag, false, 1, false, false).clone(null, true);
}
}
}
if (e != null) {
e.isTransient(true, false);
}
return e;
}
@Override
public boolean isContextSensitiveAttribute(int eTag) {
return eTag == XFA.PRESENCETAG || super.isContextSensitiveAttribute(eTag);
}
}