home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 August / PCO0897.ISO / filesbbs / os2 / fp1os2.arj / OS2 / DATA / 49 / C / 0 / F_26836 / JScriptButtonObject.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-05-15  |  2.1 KB  |  85 lines

  1. public class JScriptButtonObject extends JScriptAbstractControlObject {
  2.    private static final String NAME = "button";
  3.    private static final int BUTTON_ID_CLICK = 257;
  4.    private static final int BUTTON_ID_ONCLICK = 258;
  5.  
  6.    public JScriptButtonObject(long var1) {
  7.       super(var1);
  8.  
  9.       try {
  10.          ((JSbxObject)this).Put(new JSbxObjectProperty("click", this, this, 257, true, true));
  11.          ((JSbxObject)this).Put(new JSbxObjectProperty("onclick", this, this, 258, true, true));
  12.       } catch (JSbxException var3) {
  13.       }
  14.    }
  15.  
  16.    public JSbxValue PropertyCallFunction(JSbxObjectProperty var1, JScriptCallParam var2) throws JSbxExceptionBase {
  17.       var2.GetParamVector();
  18.       int var3 = var1.GetID();
  19.  
  20.       try {
  21.          switch (var3) {
  22.             case 257:
  23.                this.click();
  24.                break;
  25.             default:
  26.                return super.PropertyCallFunction(var1, var2);
  27.          }
  28.       } catch (UnsatisfiedLinkError var5) {
  29.       }
  30.  
  31.       Object var4 = null;
  32.       JSbxValue var6 = new JSbxValue();
  33.       var2.GetRuntimeParam().SetReturnValue(var6);
  34.       return var6;
  35.    }
  36.  
  37.    public void PropertyGet(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
  38.       int var3 = var1.GetID();
  39.  
  40.       try {
  41.          switch (var3) {
  42.             case 258:
  43.                var2.Put(new JSbxValue(this.getOnClick()));
  44.                return;
  45.             default:
  46.                super.PropertyGet(var1, var2);
  47.          }
  48.       } catch (UnsatisfiedLinkError var4) {
  49.       }
  50.    }
  51.  
  52.    public void PropertyPut(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
  53.       int var3 = var1.GetID();
  54.  
  55.       try {
  56.          switch (var3) {
  57.             case 258:
  58.                this.setOnClick(var2.GetString());
  59.                return;
  60.             default:
  61.                super.PropertyPut(var1, var2);
  62.          }
  63.       } catch (UnsatisfiedLinkError var4) {
  64.       }
  65.    }
  66.  
  67.    public String Property_GetJScript_typeofString(JSbxObjectProperty var1) {
  68.       return "button";
  69.    }
  70.  
  71.    public String GetJScriptString(boolean var1) {
  72.       return "button";
  73.    }
  74.  
  75.    protected native void click();
  76.  
  77.    protected native JScriptFunctionObject getOnClick_Fct();
  78.  
  79.    protected native void setOnClick_Fct(JScriptFunctionObject var1);
  80.  
  81.    protected native String getOnClick();
  82.  
  83.    protected native void setOnClick(String var1);
  84. }
  85.