home *** CD-ROM | disk | FTP | other *** search
- public class JScriptFrameObject extends JSbxObject implements JSbxPropertyInterface {
- private static final String NAME = "frame";
- private static final int FRAME_ID_ALERT = 1;
- private static final int FRAME_ID_CLOSE = 2;
- private static final int FRAME_ID_CONFIRM = 3;
- private static final int FRAME_ID_OPEN = 4;
- private static final int FRAME_ID_PROMPT = 5;
- private static final int FRAME_ID_SETTIMEOUT = 6;
- private static final int FRAME_ID_CLEARTIMEOUT = 7;
- private static final int FRAME_ID_FRAMES = 17;
- private static final int FRAME_ID_LENGTH = 18;
- private static final int FRAME_ID_PARENT = 19;
- private static final int FRAME_ID_SELF = 20;
- private static final int FRAME_ID_TOP = 21;
- private static final int FRAME_ID_WINDOW = 22;
- private static final int FRAME_ID_NAME = 23;
- private static final int FRAME_ID_DOCUMENT = 32;
- private static final int FRAME_ID_ONBLUR = 36;
- private static final int FRAME_ID_ONFOCUS = 37;
- JSbxObject aCacheDocument = null;
-
- public String GetName() {
- return "frame";
- }
-
- public JScriptFrameObject(long var1) {
- super(var1, JScriptManager.GetConstructorObjectForMe("DefaultConstructor"));
- this.InitFrameProps();
- }
-
- protected void InitFrameProps() {
- try {
- ((JSbxObject)this).Put(new JSbxObjectProperty("close", this, this, 2, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("open", this, this, 4, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("alert", this, this, 1, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("confirm", this, this, 3, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("prompt", this, this, 5, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("window", this, this, 22, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("length", this, this, 18, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("frames", this, this, 17, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("parent", this, this, 19, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("top", this, this, 21, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("self", this, this, 20, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("name", this, this, 23, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("document", this, this, 32, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("setTimeout", this, this, 6, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("clearTimeout", this, this, 7, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("onblur", this, this, 36, true, true));
- ((JSbxObject)this).Put(new JSbxObjectProperty("onfocus", this, this, 37, true, true));
- } catch (JSbxException var1) {
- }
- }
-
- public JSbxValue PropertyCallFunction(JSbxObjectProperty var1, JScriptCallParam var2) throws JSbxExceptionBase {
- JSbxVector var3 = var2.GetParamVector();
- int var4 = var1.GetID();
- int var5 = var3 != null ? var3.GetSize() : 0;
- String var6 = "";
- double var7 = (double)0.0F;
- JScriptFrameObject var9 = null;
- boolean var10 = false;
- boolean var11 = false;
- boolean var12 = true;
- boolean var13 = false;
- boolean var14 = false;
-
- try {
- switch (var4) {
- case 1:
- if (var5 > 0) {
- this.alert(JScriptWindowObject.GetStringParam(var3, 0));
- } else {
- this.alert("undefined");
- }
- break;
- case 2:
- this.close();
- break;
- case 3:
- var12 = false;
- var10 = true;
- if (var5 == 0) {
- var13 = this.confirm("undefined");
- }
-
- if (var5 > 0) {
- var13 = this.confirm(JScriptWindowObject.GetStringParam(var3, 0));
- }
- break;
- case 4:
- String var15 = "";
- String var16 = "";
- String var17 = "";
- var14 = true;
- var12 = false;
- if (var5 >= 1) {
- var15 = JScriptWindowObject.GetStringParam(var3, 0);
- }
-
- if (var5 >= 2) {
- var16 = JScriptWindowObject.GetStringParam(var3, 1);
- }
-
- if (var5 > 2) {
- var17 = JScriptWindowObject.GetStringParam(var3, 2);
- }
-
- var9 = this.open(var15, var16, var17);
- if (var9 != null && var9 instanceof JScriptWindowObject) {
- ((JScriptWindowObject)var9).SetOpener(this);
- }
-
- if (var5 < 1) {
- throw new JSbxException(0, "bad number of arguments for open()");
- }
- break;
- case 5:
- var12 = false;
- if (var5 == 0) {
- var6 = this.prompt("undefined", "undefined");
- }
-
- if (var5 == 1) {
- var6 = this.prompt(JScriptWindowObject.GetStringParam(var3, 0), "undefined");
- }
-
- if (var5 >= 2) {
- var6 = this.prompt(JScriptWindowObject.GetStringParam(var3, 0), JScriptWindowObject.GetStringParam(var3, 1));
- }
- break;
- case 6:
- if (var5 >= 2) {
- var12 = false;
- var11 = true;
- var7 = (double)this.SetTimeout(JScriptWindowObject.GetStringParam(var3, 0), (int)JScriptWindowObject.GetDoubleParam(var3, 1));
- }
- break;
- case 7:
- if (var5 >= 1) {
- this.ClearTimeout((int)JScriptWindowObject.GetDoubleParam(var3, 0));
- }
- break;
- default:
- throw new JSbxException(0, "no such method in frame (ID=" + var4 + ")");
- }
- } catch (UnsatisfiedLinkError var18) {
- }
-
- Object var19 = null;
- JSbxValue var20;
- if (var12) {
- var20 = new JSbxValue();
- } else if (var14) {
- var20 = new JSbxValue(var9);
- } else if (var10) {
- var20 = new JSbxValue(var13);
- } else if (var11) {
- var20 = new JSbxValue(var7);
- } else {
- var20 = new JSbxValue(var6);
- }
-
- var2.GetRuntimeParam().SetReturnValue(var20);
- return var20;
- }
-
- public void PropertyGet(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
- int var3 = var1.GetID();
-
- try {
- switch (var3) {
- case 17:
- JSbxArrayObject var4 = this.getFrames();
- if (var4 != null) {
- var4.SetArrayType("Window");
- }
-
- var2.Put(new JSbxValue(var4));
- return;
- case 18:
- var2.Put(new JSbxValue((double)this.getLength()));
- return;
- case 19:
- var2.Put(new JSbxValue(this.getParent()));
- return;
- case 20:
- var2.Put(new JSbxValue(this.getSelf()));
- return;
- case 21:
- var2.Put(new JSbxValue(this.getTop()));
- return;
- case 22:
- var2.Put(new JSbxValue(this));
- return;
- case 23:
- var2.Put(new JSbxValue(this.getName()));
- return;
- case 32:
- this.aCacheDocument = this.getDocument();
- var2.Put(new JSbxValue(this.aCacheDocument));
- return;
- case 36:
- var2.Put(new JSbxValue(this.getOnBlur()));
- return;
- case 37:
- var2.Put(new JSbxValue(this.getOnFocus()));
- return;
- default:
- throw new JSbxException(0, "no such property in frame (ID=" + var3 + ")");
- }
- } catch (UnsatisfiedLinkError var5) {
- }
- }
-
- public void PropertyPut(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
- int var3 = var1.GetID();
-
- try {
- switch (var3) {
- case 23:
- break;
- case 36:
- this.setOnBlur(var2.GetString());
- return;
- case 37:
- this.setOnFocus(var2.GetString());
- return;
- default:
- throw new JSbxException(0, "no such property in frame (ID=" + var3 + ")");
- }
- } catch (UnsatisfiedLinkError var4) {
- }
-
- }
-
- public String Property_GetJScript_typeofString(JSbxObjectProperty var1) {
- return "frame";
- }
-
- public String GetJScriptString(boolean var1) {
- return "[object Frame]";
- }
-
- protected native int getLength();
-
- protected native String getName();
-
- protected native JSbxArrayObject getFrames();
-
- protected native JScriptFrameObject getParent();
-
- protected native JScriptFrameObject getTop();
-
- protected native JScriptFrameObject getSelf();
-
- protected native void alert(String var1);
-
- protected native boolean confirm(String var1);
-
- protected native String prompt(String var1, String var2);
-
- protected native void close();
-
- protected native JScriptFrameObject open(String var1, String var2, String var3);
-
- protected native JScriptDocumentObject getDocument();
-
- protected native int SetTimeout(String var1, int var2);
-
- protected native void ClearTimeout(int var1);
-
- protected native String getOnBlur();
-
- protected native void setOnBlur(String var1);
-
- protected native String getOnFocus();
-
- protected native void setOnFocus(String var1);
-
- protected native void StopAllJavaScripts();
- }
-