home *** CD-ROM | disk | FTP | other *** search
- public class JScriptOptionObject extends JSbxObject implements JSbxPropertyInterface {
- public static final String NAME = "Option";
- private static final int OPTION_ID_DEFAULTSELECTED = 257;
- private static final int OPTION_ID_INDEX = 258;
- private static final int OPTION_ID_SELECTED = 259;
- private static final int OPTION_ID_TEXT = 261;
- private static final int OPTION_ID_VALUE = 262;
- private String aOptionText;
- private String aOptionValue;
- private boolean bDefaultSelected;
- private boolean bSelected;
- private int nIndex;
- private JScriptSelectObject pSelectObject;
- private boolean bFreeObject;
-
- public String getOptionText() {
- return this.aOptionText;
- }
-
- public String getOptionValue() {
- return this.aOptionValue;
- }
-
- public boolean getDefaultSelected() {
- return this.bDefaultSelected;
- }
-
- public boolean getSelected() {
- return this.bSelected;
- }
-
- public int getIndex() {
- return this.nIndex;
- }
-
- public void setIndex(int var1) {
- this.nIndex = var1;
- }
-
- public JScriptSelectObject getSelectObject() {
- return this.pSelectObject;
- }
-
- public void setSelectObject(JScriptSelectObject var1) {
- this.pSelectObject = var1;
- }
-
- public JScriptOptionObject(JScriptConstructor var1) {
- super(var1);
- this.bFreeObject = true;
- this.pSelectObject = null;
- this.CreateProperties();
- }
-
- public JScriptOptionObject(JScriptSelectObject var1, int var2) {
- this.bFreeObject = false;
- this.pSelectObject = var1;
- this.nIndex = var2;
- this.CreateProperties();
- }
-
- private void CreateProperties() {
- try {
- ((JSbxObject)this).Put(new JSbxObjectProperty("defaultSelected", this, this, 257));
- ((JSbxObject)this).Put(new JSbxObjectProperty("index", this, this, 258));
- ((JSbxObject)this).Put(new JSbxObjectProperty("selected", this, this, 259));
- ((JSbxObject)this).Put(new JSbxObjectProperty("text", this, this, 261));
- ((JSbxObject)this).Put(new JSbxObjectProperty("value", this, this, 262));
- } catch (JSbxException var1) {
- }
- }
-
- public JSbxValue PropertyCallFunction(JSbxObjectProperty var1, JScriptCallParam var2) throws JSbxExceptionBase {
- return null;
- }
-
- public void PropertyGet(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
- int var3 = var1.GetID();
- if (!this.bFreeObject && this.pSelectObject == null) {
- throw new JSbxException(0, "no such property (ID=" + var3 + ")");
- } else {
- JSbxValue var4 = null;
- boolean var5 = false;
- if (this.pSelectObject == null) {
- switch (var3) {
- case 257:
- var4 = new JSbxValue(this.bDefaultSelected);
- break;
- case 258:
- var4 = new JSbxValue((double)this.nIndex);
- break;
- case 259:
- var4 = new JSbxValue(this.bSelected);
- break;
- case 260:
- default:
- var5 = true;
- break;
- case 261:
- var4 = new JSbxValue(this.aOptionText);
- break;
- case 262:
- var4 = new JSbxValue(this.aOptionValue);
- }
- } else {
- try {
- switch (var3) {
- case 257:
- var4 = new JSbxValue(this.pSelectObject.getOptionDefaultSelected(this.nIndex));
- break;
- case 258:
- var4 = new JSbxValue((double)this.nIndex);
- break;
- case 259:
- var4 = new JSbxValue(this.pSelectObject.getOptionSelected(this.nIndex));
- break;
- case 260:
- default:
- var5 = true;
- break;
- case 261:
- var4 = new JSbxValue(this.pSelectObject.getOptionText(this.nIndex));
- break;
- case 262:
- var4 = new JSbxValue(this.pSelectObject.getOptionValue(this.nIndex));
- }
- } catch (UnsatisfiedLinkError var6) {
- }
- }
-
- if (var4 != null) {
- var2.Put(var4);
- } else {
- if (var5) {
- ((JSbxObject)this).GetConstructor().PropertyGet(var1, var2);
- }
-
- }
- }
- }
-
- public void PropertyPut(JSbxObjectProperty var1, JSbxValue var2) throws JSbxException {
- int var3 = var1.GetID();
- if (!this.bFreeObject && this.pSelectObject == null) {
- throw new JSbxException(0, "no such property (ID=" + var3 + ")");
- } else if (this.pSelectObject == null) {
- switch (var3) {
- case 257:
- this.bDefaultSelected = var2.GetBool();
- return;
- case 258:
- case 260:
- default:
- ((JSbxObject)this).GetConstructor().PropertyPut(var1, var2);
- return;
- case 259:
- this.bSelected = var2.GetBool();
- return;
- case 261:
- this.aOptionText = var2.GetString();
- return;
- case 262:
- this.aOptionValue = var2.GetString();
- }
- } else {
- try {
- switch (var3) {
- case 257:
- this.pSelectObject.setOptionDefaultSelected(var2.GetBool(), this.nIndex);
- return;
- case 258:
- case 260:
- default:
- ((JSbxObject)this).GetConstructor().PropertyPut(var1, var2);
- return;
- case 259:
- this.pSelectObject.setOptionSelected(var2.GetBool(), this.nIndex);
- return;
- case 261:
- this.pSelectObject.setOptionText(var2.GetString(), this.nIndex);
- return;
- case 262:
- this.pSelectObject.setOptionValue(var2.GetString(), this.nIndex);
- }
- } catch (UnsatisfiedLinkError var4) {
- }
- }
- }
-
- public String Property_GetJScript_typeofString(JSbxObjectProperty var1) {
- return "option";
- }
-
- public String GetJScriptString(boolean var1) {
- return "option";
- }
-
- public final void SaveConstructorValues(String var1, String var2, boolean var3, boolean var4) {
- this.aOptionText = var1;
- this.aOptionValue = var2;
- this.bDefaultSelected = var3;
- this.bSelected = var4;
- }
-
- protected native String getValue();
- }
-