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

  1. import java.awt.Component;
  2.  
  3. abstract class JScriptControlObject extends JSbxObject implements JSbxPropertyInterface {
  4.    private static final int CONTROL_ID_NAME = 16;
  5.    private static final int CONTROL_ID_VALUE = 17;
  6.    private Component aComponent;
  7.    private String aName;
  8.  
  9.    protected Component GetControl() {
  10.       return this.aComponent;
  11.    }
  12.  
  13.    public String GetName() {
  14.       return this.aName;
  15.    }
  16.  
  17.    public void SetName(String var1) {
  18.       this.aName = var1;
  19.    }
  20.  
  21.    public JScriptControlObject(String var1, Component var2) {
  22.       this.aComponent = var2;
  23.       this.aName = var1;
  24.  
  25.       try {
  26.          ((JSbxObject)this).Put(new JSbxObjectProperty("name", this, this, 16));
  27.          ((JSbxObject)this).Put(new JSbxObjectProperty("value", this, this, 17));
  28.       } catch (JSbxException var3) {
  29.          System.out.println("Unerwartete Exception im JScriptControlObject()-Ctor");
  30.       }
  31.    }
  32.  
  33.    public JSbxValue PropertyCallFunction(JSbxObjectProperty var1, JScriptCallParam var2) throws JSbxExceptionBase {
  34.       var2.GetParamVector();
  35.       int var3 = var1.GetID();
  36.       switch (var3) {
  37.          case 0:
  38.          default:
  39.             throw new JSbxException(0, "no such method in Control (ID=" + var3 + ")");
  40.       }
  41.    }
  42.  
  43.    public void PropertyGet(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
  44.       int var3 = var1.GetID();
  45.       switch (var3) {
  46.          case 16:
  47.             var2.Put(new JSbxValue(this.GetName()));
  48.             return;
  49.          case 17:
  50.             var2.Put(new JSbxValue(this.GetValue()));
  51.             return;
  52.          default:
  53.             throw new JSbxException(0, "no such property in Control (ID=" + var3 + ")");
  54.       }
  55.    }
  56.  
  57.    public void PropertyPut(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
  58.       int var3 = var1.GetID();
  59.       switch (var3) {
  60.          case 16:
  61.             this.SetName(var2.GetString());
  62.             return;
  63.          case 17:
  64.             this.SetValue(var2.GetString());
  65.             return;
  66.          default:
  67.             throw new JSbxException(0, "no such property in Control (ID=" + var3 + ")");
  68.       }
  69.    }
  70.  
  71.    public String Property_GetJScript_typeofString(JSbxObjectProperty var1) {
  72.       return "control";
  73.    }
  74.  
  75.    public String GetJScriptString(boolean var1) {
  76.       return "Control (internal) ?";
  77.    }
  78.  
  79.    public abstract String GetValue();
  80.  
  81.    public abstract void SetValue(String var1);
  82. }
  83.