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

  1. public class JScriptCheckboxObject extends JScriptAbstractControlObject {
  2.    private static final int CHECKBOX_ID_CHECKED = 257;
  3.    private static final int CHECKBOX_ID_DEFAULTCHECKED = 258;
  4.    private static final int CHECKBOX_ID_CLICK = 259;
  5.    private static final int CHECKBOX_ID_ONCLICK = 260;
  6.  
  7.    public JScriptCheckboxObject(long var1) {
  8.       super(var1);
  9.  
  10.       try {
  11.          ((JSbxObject)this).Put(new JSbxObjectProperty("checked", this, this, 257, true));
  12.          ((JSbxObject)this).Put(new JSbxObjectProperty("defaultChecked", this, this, 258, true));
  13.          ((JSbxObject)this).Put(new JSbxObjectProperty("click", this, this, 259, true));
  14.          ((JSbxObject)this).Put(new JSbxObjectProperty("onclick", this, this, 260, true));
  15.          ((JSbxObject)this).Put(new JSbxObjectProperty("status", this, this, 257, true));
  16.          ((JSbxObject)this).Put(new JSbxObjectProperty("defaultStatus", this, this, 258, true));
  17.       } catch (JSbxException var3) {
  18.       }
  19.    }
  20.  
  21.    public JSbxValue PropertyCallFunction(JSbxObjectProperty var1, JScriptCallParam var2) throws JSbxExceptionBase {
  22.       int var3 = var1.GetID();
  23.  
  24.       try {
  25.          switch (var3) {
  26.             case 259:
  27.                this.click();
  28.                break;
  29.             default:
  30.                return super.PropertyCallFunction(var1, var2);
  31.          }
  32.       } catch (UnsatisfiedLinkError var5) {
  33.       }
  34.  
  35.       Object var4 = null;
  36.       JSbxValue var6 = new JSbxValue();
  37.       var2.GetRuntimeParam().SetReturnValue(var6);
  38.       return var6;
  39.    }
  40.  
  41.    public void PropertyGet(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
  42.       int var3 = var1.GetID();
  43.  
  44.       try {
  45.          switch (var3) {
  46.             case 257:
  47.                var2.Put(new JSbxValue(this.getChecked()));
  48.                return;
  49.             case 258:
  50.                var2.Put(new JSbxValue(this.getDefaultChecked()));
  51.                return;
  52.             case 259:
  53.             default:
  54.                super.PropertyGet(var1, var2);
  55.                return;
  56.             case 260:
  57.                var2.Put(new JSbxValue(this.getOnClick()));
  58.          }
  59.       } catch (UnsatisfiedLinkError var4) {
  60.       }
  61.    }
  62.  
  63.    public void PropertyPut(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
  64.       int var3 = var1.GetID();
  65.  
  66.       try {
  67.          switch (var3) {
  68.             case 257:
  69.                this.setChecked(var2.GetBool());
  70.                return;
  71.             case 258:
  72.                this.setDefaultChecked(var2.GetBool());
  73.                return;
  74.             case 259:
  75.             default:
  76.                if (var3 == 66) {
  77.                   this.setValue(var2.GetString());
  78.                   return;
  79.                }
  80.  
  81.                super.PropertyPut(var1, var2);
  82.                return;
  83.             case 260:
  84.                this.setOnClick(var2.GetString());
  85.          }
  86.       } catch (UnsatisfiedLinkError var4) {
  87.       }
  88.    }
  89.  
  90.    public String GetJScriptString(boolean var1) {
  91.       return "checkbox";
  92.    }
  93.  
  94.    protected native boolean getChecked();
  95.  
  96.    protected native void setChecked(boolean var1);
  97.  
  98.    protected native boolean getDefaultChecked();
  99.  
  100.    protected native void setDefaultChecked(boolean var1);
  101.  
  102.    protected native void setValue(String var1);
  103.  
  104.    protected native void click();
  105.  
  106.    protected native String getOnClick();
  107.  
  108.    protected native void setOnClick(String var1);
  109. }
  110.