001 
002 /*
003  *  JScripter Standard 1.0 - To Script In Java
004  *  Copyright (C) 2008-2011  J.J.Liu<jianjunliu@126.com> <http://www.jscripter.org>
005  *  
006  *  This program is free software: you can redistribute it and/or modify
007  *  it under the terms of the GNU Affero General Public License as published by
008  *  the Free Software Foundation, either version 3 of the License, or
009  *  (at your option) any later version.
010  *  
011  *  This program is distributed in the hope that it will be useful,
012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014  *  GNU Affero General Public License for more details.
015  *  
016  *  You should have received a copy of the GNU Affero General Public License
017  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
018  */
019 
020 package js.user;
021 
022 import js.*;
023 import js.core.*;
024 
025 /**
026  * <p>An <b>opaque</b> class representing JavaScript client-side objects of the global 
027  * {@link JsClient#HTMLTableCaptionElement} class.</p>
028  * <p>This class represents a table caption 
029  * in an HTML page, or a {@link JsHTMLElement} object created with the HTML 
030  * <tt>&lt;caption&gt;</tt> tag.</p>
031  * <p>The <tt>&lt;caption&gt;</tt> element is only permitted immediately after the 
032  * <tt>&lt;table&gt;</tt> start tag and it's text should describe the nature of the 
033  * table. A <tt>&lt;table&gt;</tt> element may only contain one <tt>&lt;caption&gt;</tt> 
034  * element.</p>
035  *
036  * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
037  *
038  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
039  * generated into the target codes. Re-compilers must exit with error on the operations of
040  * accessing that kind of class objects.
041  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
042  * and <tt>instanceof</tt> to it always <tt>true</tt>.
043  */
044 public class JsHTMLTableCaptionElement extends JsClient.HTMLTableCaptionElement.Prototype
045 {
046     /**
047      * <p>An <b>internal</b> class containing membership data for its enclosing
048      * opaque class.</p>
049      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
050      * class members.</p>
051      *
052      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
053      * 
054      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
055      */
056     protected static abstract class Members extends JsClient.HTMLTableCaptionElement.Prototype.Members
057     {
058         /**
059          * <p>An <b>internal</b> static field defining a member ID of the field name and
060          * used internally to define a member of the same name.</p>
061          * @since 1.0
062          * @see JsHTMLTableCaptionElement#align
063          * @see JsHTMLTableCaptionElement.Member#align
064          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
065          */
066         public final static Mid align = id("align");
067     }
068     /**
069      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
070      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
071      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
072      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
073      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
074      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
075      * either circumstance, the field names must be exactly same as the member names, as 
076      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
077      * based on the field names.</p>
078      *
079      * @author <a href="mailto:jianjunliu@126.com">J.J.Liu (Jianjun Liu)</a> at <a href="http://www.jscripter.org" target="_blank">http://www.jscripter.org</a>
080      * 
081      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
082      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
083      * of class objects.
084      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
085      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
086      * <pre>q.m</pre>
087      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
088      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
089      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
090      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
091      * <pre>m</pre>
092      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
093      * error on the access to <b>opaque</b> fields declared by this class under any other 
094      * circumstances.
095      */
096     public static class Member extends JsClient.HTMLTableCaptionElement.Prototype.Member
097     {
098         /**
099          * <p>Internally constructs a member based on a qualifying member.</p>
100          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
101          * or <b>internal</b> classes or class members.</p>
102          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
103          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
104          * declared in the declaring class of this constructor itself or its subclasses. 
105          * Under this circumstance, the field names must be exactly same as the member 
106          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
107          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
108          * to their names appending to the name resolved from the specified qualifying 
109          * member with a dot in between.</p>
110          * @param q A qualifying member
111          * @param mid The ID of the member to construct
112          * @since 1.0
113          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
114          */
115         public Member(JsObject.Member q, Mid mid) {
116             super(q, mid);
117         }
118         /**
119          * <p>Internally constructs a member without a qualifying member.</p>
120          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
121          * or <b>internal</b> classes or class members.</p>
122          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
123          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
124          * declared in <b>opaque</b> types other than the declaring class of this constructor 
125          * itself and its subclasses. Under this circumstance, the field names must be
126          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
127          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
128          * @param mid The ID of the member to construct
129          * @since 1.0
130          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
131          */
132         public Member(Mid mid) {
133             super(mid);
134         }
135         @Override
136         /**
137          * <p>Evaluates the property, represented by the current member instance, of the
138          * argument object.</p>
139          * @param o The argument object
140          * @return The value of the current member based on the object argument.
141          * @since 1.0
142          * @javascript Re-compilers must convert the instance invocation of this method into
143          * the JavaScript expression: 
144          * <pre>o.m</pre>
145          * where <tt>m</tt> is the identifier name resolved from the current member
146          * instance of the invocation.
147          */
148         public JsHTMLTableCaptionElement with(ObjectLike o) {
149             return new JsHTMLTableCaptionElement(super.with(o));
150         }
151 
152         /**
153          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
154          * name of this field, qualified by the current member instance of the field, and 
155          * to access the property of the name on an object.</p>
156          * <p>The property, identified by this member, of a {@link JsHTMLTableCaptionElement} 
157          * object refers to a string specifying the horizontal alignment of the element 
158          * with respect to the surrounding context. Possible values are:
159          * <ul>
160          * <li><tt>"left"</tt>: text lines are rendered flush left.</li>
161          * <li><tt>"center"</tt>: text lines are centered.</li>
162          * <li><tt>"right"</tt>: text lines are rendered flush right.</li>
163          * <li><tt>"justify"</tt>: text lines are justified to both margins.</li>
164          * </ul>
165          * The default value of this attribute depends on the base text direction. 
166          * For left to right text, the default is "left", while for right to left text, 
167          * it is "right".</p>
168          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
169          * @since 1.0
170          * @javascript Re-compilers must resolve the member of this instance field to the
171          * identifier of the field name appending to the identifier resolved from its 
172          * qualifying member with a dot in between.
173          */
174         public final Value.String.Member align = new Value.String.Member(this, Members.align);
175     }
176 
177     /**
178      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
179      * with the wrapping constructor.</p>
180      * @param var The argument of an <b>opaque</b> object.
181      * @since 1.0
182      * @javascript Re-compilers must ignore the construction operation of this constructor,
183      * that is, replacing it with its only argument.
184      */
185     public JsHTMLTableCaptionElement(JsObject var) {
186         super(var);
187     }
188 
189     /**
190      * <p>An <b>opaque</b> static field defining a member that is named by the field name
191      * without a qualifying member and to access the property of the name on an object.</p>
192      * <p>The property, identified by this member, of a {@link JsHTMLTableCaptionElement} 
193      * object refers to a string specifying the horizontal alignment of the element 
194      * with respect to the surrounding context. Possible values are:
195      * <ul>
196      * <li><tt>"left"</tt>: text lines are rendered flush left.</li>
197      * <li><tt>"center"</tt>: text lines are centered.</li>
198      * <li><tt>"right"</tt>: text lines are rendered flush right.</li>
199      * <li><tt>"justify"</tt>: text lines are justified to both margins.</li>
200      * </ul>
201      * The default value of this attribute depends on the base text direction. 
202      * For left to right text, the default is "left", while for right to left text, 
203      * it is "right".</p>
204      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
205      * @since 1.0
206      * @javascript Re-compilers must resolve the member of this static field to the
207      * identifier of the field name.
208      */
209     public static final Value.String.Member align = new Value.String.Member(Members.align);
210 
211     @Override
212     /**
213      * <p>Removes the option element at the specified position.</p>
214      * @param index The position within the {@link #options} array of the option element 
215      * to be removed.
216      * @since 1.0
217      * @see #remove(Number)
218      * @javascript Re-compilers must convert the instance invocation of this method directly
219      * into a JavaScript invocation on its current object instance without changing the 
220      * method name, but expanding variable arguments, if any, into comma-separated values. 
221      */
222     public final JsHTMLTableCaptionElement valueOf() {
223         return new JsHTMLTableCaptionElement((JsObject)var().valueOf());
224     }
225 }