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

  1. public class JScriptTextObject extends JScriptAbstractControlObject {
  2.    private static final int TEXT_ID_DEFAULTVALUE = 257;
  3.    private static final int TEXT_ID_FOCUS = 258;
  4.    private static final int TEXT_ID_BLUR = 259;
  5.    private static final int TEXT_ID_SELECT = 260;
  6.    private static final int TEXT_ID_ONBLUR = 261;
  7.    private static final int TEXT_ID_ONFOCUS = 262;
  8.    private static final int TEXT_ID_ONSELECT = 263;
  9.    private static final int TEXT_ID_ONCHANGE = 264;
  10.  
  11.    public JScriptTextObject(long var1) {
  12.       super(var1);
  13.  
  14.       try {
  15.          ((JSbxObject)this).Put(new JSbxObjectProperty("defaultValue", this, this, 257, true));
  16.          ((JSbxObject)this).Put(new JSbxObjectProperty("focus", this, this, 258, true));
  17.          ((JSbxObject)this).Put(new JSbxObjectProperty("blur", this, this, 259, true));
  18.          ((JSbxObject)this).Put(new JSbxObjectProperty("select", this, this, 260, true));
  19.          ((JSbxObject)this).Put(new JSbxObjectProperty("onblur", this, this, 261, true));
  20.          ((JSbxObject)this).Put(new JSbxObjectProperty("onfocus", this, this, 262, true));
  21.          ((JSbxObject)this).Put(new JSbxObjectProperty("onselect", this, this, 263, true));
  22.          ((JSbxObject)this).Put(new JSbxObjectProperty("onchange", this, this, 264, true));
  23.       } catch (JSbxException var3) {
  24.       }
  25.    }
  26.  
  27.    public JSbxValue PropertyCallFunction(JSbxObjectProperty var1, JScriptCallParam var2) throws JSbxExceptionBase {
  28.       int var3 = var1.GetID();
  29.  
  30.       try {
  31.          switch (var3) {
  32.             case 258:
  33.                this.focus();
  34.                break;
  35.             case 259:
  36.                this.blur();
  37.                break;
  38.             case 260:
  39.                this.select();
  40.                break;
  41.             default:
  42.                return super.PropertyCallFunction(var1, var2);
  43.          }
  44.       } catch (UnsatisfiedLinkError var5) {
  45.       }
  46.  
  47.       Object var4 = null;
  48.       JSbxValue var6 = new JSbxValue();
  49.       var2.GetRuntimeParam().SetReturnValue(var6);
  50.       return var6;
  51.    }
  52.  
  53.    public void PropertyGet(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
  54.       int var3 = var1.GetID();
  55.  
  56.       try {
  57.          switch (var3) {
  58.             case 257:
  59.                var2.Put(new JSbxValue(this.getDefaultValue()));
  60.                return;
  61.             case 261:
  62.                var2.Put(new JSbxValue(this.getOnBlur()));
  63.                return;
  64.             case 262:
  65.                var2.Put(new JSbxValue(this.getOnFocus()));
  66.                return;
  67.             case 263:
  68.                var2.Put(new JSbxValue(this.getOnSelect()));
  69.                return;
  70.             case 264:
  71.                var2.Put(new JSbxValue(this.getOnChange()));
  72.                return;
  73.             default:
  74.                super.PropertyGet(var1, var2);
  75.          }
  76.       } catch (UnsatisfiedLinkError var4) {
  77.       }
  78.    }
  79.  
  80.    public void PropertyPut(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
  81.       int var3 = var1.GetID();
  82.  
  83.       try {
  84.          switch (var3) {
  85.             case 257:
  86.                this.setDefaultValue(var2.GetString());
  87.                return;
  88.             case 261:
  89.                this.setOnBlur(var2.GetString());
  90.                return;
  91.             case 262:
  92.                this.setOnFocus(var2.GetString());
  93.                return;
  94.             case 263:
  95.                this.setOnSelect(var2.GetString());
  96.                return;
  97.             case 264:
  98.                this.setOnChange(var2.GetString());
  99.                return;
  100.             default:
  101.                super.PropertyPut(var1, var2);
  102.          }
  103.       } catch (UnsatisfiedLinkError var4) {
  104.       }
  105.    }
  106.  
  107.    public String GetJScriptString(boolean var1) {
  108.       return "text";
  109.    }
  110.  
  111.    protected native String getDefaultValue();
  112.  
  113.    protected native void setDefaultValue(String var1);
  114.  
  115.    protected native void focus();
  116.  
  117.    protected native void blur();
  118.  
  119.    protected native void select();
  120.  
  121.    protected native String getOnBlur();
  122.  
  123.    protected native void setOnBlur(String var1);
  124.  
  125.    protected native String getOnChange();
  126.  
  127.    protected native void setOnChange(String var1);
  128.  
  129.    protected native String getOnFocus();
  130.  
  131.    protected native void setOnFocus(String var1);
  132.  
  133.    protected native String getOnSelect();
  134.  
  135.    protected native void setOnSelect(String var1);
  136. }
  137.