Items.java
1.85 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.template;
import com.adobe.xfa.Delta;
import com.adobe.xfa.Element;
import com.adobe.xfa.Node;
import com.adobe.xfa.Obj;
import com.adobe.xfa.ProtoableNode;
import com.adobe.xfa.XFA;
import com.adobe.xfa.XFAList;
import com.adobe.xfa.content.TextValue;
import org.xml.sax.Attributes;
public final class Items
extends ProtoableNode {
public Items(Element parent, Node prevSibling) {
super(parent, prevSibling, null, "items", "items", null, XFA.ITEMSTAG, "items");
}
public void addItem(String sItemValue, boolean bDefault) {
TextValue bound = new TextValue(this, null);
bound.setValue(sItemValue);
if (!bDefault) {
this.makeNonDefault(true);
}
}
public void clearItems(boolean bDefault) {
Node child = this.getFirstXFAChild();
while (child != null) {
Node next = child.getNextXFASibling();
this.removeChild(child);
child = next;
}
if (!bDefault) {
this.makeNonDefault(true);
}
}
public void removeItem(int nIndex, boolean bDefault) {
Node child = this.getXFAChild(nIndex);
if (child != null) {
child.remove();
if (!bDefault) {
this.makeNonDefault(true);
}
}
}
@Override
public void getDeltas(Element delta, XFAList list) {
if (this.isSameClass(delta) && list != null) {
Element parent = this.getXFAParent();
Element deltaParent = delta.getXFAParent();
Delta newDelta = new Delta(parent, deltaParent, this, delta, "");
list.append(newDelta);
}
}
@Override
public void makeNonDefault(boolean bRecursive) {
if (this.isDefault(false)) {
this.fullyResolve(true);
}
}
}