FormInstanceManagerScript.java
3.68 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
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.xfa.form;
import com.adobe.xfa.Arg;
import com.adobe.xfa.Node;
import com.adobe.xfa.Obj;
import com.adobe.xfa.ProtoableNodeScript;
import com.adobe.xfa.ScriptFuncObj;
import com.adobe.xfa.ScriptPropObj;
import com.adobe.xfa.ScriptTable;
import com.adobe.xfa.form.FormInstanceManager;
public class FormInstanceManagerScript
extends ProtoableNodeScript {
protected static final ScriptTable moScriptTable = new ScriptTable(ProtoableNodeScript.moScriptTable, "instanceManager", new ScriptPropObj[]{new ScriptPropObj(FormInstanceManagerScript.class, "min", "getMin", null, 4, 21, 9, 0), new ScriptPropObj(FormInstanceManagerScript.class, "max", "getMax", null, 4, 21, 9, 0), new ScriptPropObj(FormInstanceManagerScript.class, "count", "getCount", "setCount", 4, 21, 9, 0)}, new ScriptFuncObj[]{new ScriptFuncObj(FormInstanceManagerScript.class, "setInstances", "setInstances", 1, new int[]{4}, 1, 21, 9, "instanceManagerPermsCheck", 0), new ScriptFuncObj(FormInstanceManagerScript.class, "addInstance", "addInstance", 7, new int[]{3}, 0, 21, 9, "instanceManagerPermsCheck", 0), new ScriptFuncObj(FormInstanceManagerScript.class, "insertInstance", "insertInstance", 7, new int[]{4, 3}, 1, 25, 9, "instanceManagerPermsCheck", 0), new ScriptFuncObj(FormInstanceManagerScript.class, "removeInstance", "removeInstance", 1, new int[]{4}, 1, 21, 9, "instanceManagerPermsCheck", 0), new ScriptFuncObj(FormInstanceManagerScript.class, "moveInstance", "moveInstance", 1, new int[]{4, 4}, 2, 21, 9, "instanceManagerPermsCheck", 0)});
public static ScriptTable getScriptTable() {
return moScriptTable;
}
public static void getMin(Obj obj, Arg retVal) {
retVal.setInteger(((FormInstanceManager)obj).getMin());
}
public static void getMax(Obj obj, Arg retVal) {
retVal.setInteger(((FormInstanceManager)obj).getMax());
}
public static void getCount(Obj obj, Arg retVal) {
retVal.setInteger(((FormInstanceManager)obj).getCount());
}
public static void setCount(Obj obj, Arg arg) {
if (arg.getArgType() != 2) {
((FormInstanceManager)obj).setInstances(arg.getInteger(), true);
}
}
public static void setInstances(Obj obj, Arg retVal, Arg[] args) {
((FormInstanceManager)obj).setInstances(args[0].getInteger(), true);
}
public static void addInstance(Obj obj, Arg retVal, Arg[] args) {
FormInstanceManager manager = (FormInstanceManager)obj;
if (args.length == 0) {
retVal.setObject(manager.addInstance(manager.getCount(), true));
} else if (args.length == 1) {
retVal.setObject(manager.addInstance(manager.getCount(), (boolean)args[0].getBool()));
}
}
public static void insertInstance(Obj obj, Arg retVal, Arg[] args) {
FormInstanceManager manager = (FormInstanceManager)obj;
if (args.length == 1) {
retVal.setObject(manager.addInstance(args[0].getInteger(), true));
} else if (args.length == 2) {
retVal.setObject(manager.addInstance(args[0].getInteger(), (boolean)args[1].getBool()));
}
}
public static void removeInstance(Obj obj, Arg retVal, Arg[] args) {
((FormInstanceManager)obj).removeInstance(args[0].getInteger(), true);
}
public static void moveInstance(Obj obj, Arg retVal, Arg[] args) {
((FormInstanceManager)obj).moveInstance(args[0].getInteger(), args[1].getInteger(), true);
}
public static boolean instanceManagerPermsCheck(Obj obj, Arg[] args) {
if (obj instanceof FormInstanceManager && !((FormInstanceManager)obj).instanceManagerPermsCheck()) {
return false;
}
return true;
}
}