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#HTMLTableColElement} class.</p>
028  * <p>This class represents a table column 
029  * in an HTML page, or a {@link JsHTMLElement} object created with the HTML 
030  * <tt>&lt;col&gt;</tt> tag.</p>
031  *
032  * @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>
033  *
034  * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be
035  * generated into the target codes. Re-compilers must exit with error on the operations of
036  * accessing that kind of class objects.
037  * The <tt>checkcast</tt> operation to the class literal of this interface must be ignored
038  * and <tt>instanceof</tt> to it always <tt>true</tt>.
039  */
040 public class JsHTMLTableColElement extends JsClient.HTMLTableColElement.Prototype
041 {
042     /**
043      * <p>An <b>internal</b> class containing membership data for its enclosing
044      * opaque class.</p>
045      * <p>This class is only used inside of <b>opaque</b> or <b>internal</b> classes or
046      * class members.</p>
047      *
048      * @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>
049      * 
050      * @javascript Re-compilers must report error on resolving an <b>internal</b> class.
051      */
052     protected static abstract class Members extends JsClient.HTMLTableColElement.Prototype.Members
053     {
054         /**
055          * <p>An <b>internal</b> static field defining a member ID of the field name and
056          * used internally to define a member of the same name.</p>
057          * @since 1.0
058          * @see JsHTMLTableColElement#align
059          * @see JsHTMLTableColElement.Member#align
060          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
061          */
062         public final static Mid align  = id("align" );
063         /**
064          * <p>An <b>internal</b> static field defining a member ID of the field name and
065          * used internally to define a member of the same name.</p>
066          * @since 1.0
067          * @see JsHTMLTableColElement#ch
068          * @see JsHTMLTableColElement.Member#ch
069          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
070          */
071         public final static Mid ch     = id("ch"    );
072         /**
073          * <p>An <b>internal</b> static field defining a member ID of the field name and
074          * used internally to define a member of the same name.</p>
075          * @since 1.0
076          * @see JsHTMLTableColElement#chOff
077          * @see JsHTMLTableColElement.Member#chOff
078          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
079          */
080         public final static Mid chOff  = id("chOff" );
081         /**
082          * <p>An <b>internal</b> static field defining a member ID of the field name and
083          * used internally to define a member of the same name.</p>
084          * @since 1.0
085          * @see JsHTMLTableColElement#span
086          * @see JsHTMLTableColElement.Member#span
087          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
088          */
089         public final static Mid span   = id("span"  );
090         /**
091          * <p>An <b>internal</b> static field defining a member ID of the field name and
092          * used internally to define a member of the same name.</p>
093          * @since 1.0
094          * @see JsHTMLTableColElement#vAlign
095          * @see JsHTMLTableColElement.Member#vAlign
096          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
097          */
098         public final static Mid vAlign = id("vAlign");
099         /**
100          * <p>An <b>internal</b> static field defining a member ID of the field name and
101          * used internally to define a member of the same name.</p>
102          * @since 1.0
103          * @see JsHTMLTableColElement#width
104          * @see JsHTMLTableColElement.Member#width
105          * @javascript Re-compilers must report error on accessing an <b>internal</b> field.
106          */
107         public final static Mid width  = id("width" );
108     }
109     /**
110      * <p>An <b>opaque</b> class representing members of its enclosing <b>opaque</b> type.</p>
111      * <p>Note that, this class is <b>opaque</b> but its constructors are all <b>internal</b>. 
112      * This class and the subclasses of this class are used to declare either <b>opaque</b> 
113      * <tt>public</tt> instance fields of the opaque type {@link js.Var.Member} or the 
114      * <b>opaque</b> <tt>public</tt> static fields of other <b>opaque</b> types while their 
115      * constructors are used to define the fields inside <b>opaque</b> classes. Under 
116      * either circumstance, the field names must be exactly same as the member names, as 
117      * the <b>opaque</b> fields of <b>opaque</b> types are resolved by re-compilers directly 
118      * based on the field names.</p>
119      *
120      * @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>
121      * 
122      * @javascript <b>Opaque</b> types can be resolved but no class objects for them can be created
123      * in the target codes. Re-compilers must exit with error on operations accessing that kind 
124      * of class objects.
125      * Re-compilers must resolve an <b>opaque</b> instance field declared by this class in
126      * {@link js.Var.Member} or its subclasses to the JavaScript identifier: 
127      * <pre>q.m</pre>
128      * where <tt>m</tt> is the identifier of the field name and <tt>q</tt> is the identifier
129      * resolved from the instance of the enclosing member. Re-compilers must resolve an 
130      * <b>opaque</b> static field declared by this class in <b>opaque</b> types other than 
131      * {@link js.Var.Member} and its subclasses to the JavaScript identifier: 
132      * <pre>m</pre>
133      * where <tt>m</tt> is the identifier of the field name. And re-compilers must report
134      * error on the access to <b>opaque</b> fields declared by this class under any other 
135      * circumstances.
136      */
137     public static class Member extends JsClient.HTMLTableColElement.Prototype.Member
138     {
139         /**
140          * <p>Internally constructs a member based on a qualifying member.</p>
141          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
142          * or <b>internal</b> classes or class members.</p>
143          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
144          * <b>opaque</b>. This constructor is used to define <b>opaque</b> instance fields 
145          * declared in the declaring class of this constructor itself or its subclasses. 
146          * Under this circumstance, the field names must be exactly same as the member 
147          * names, as the <b>opaque</b> instance fields of the <b>opaque</b> type 
148          * {@link js.Var.Member} or its subclasses are resolved by re-compilers directly
149          * to their names appending to the name resolved from the specified qualifying 
150          * member with a dot in between.</p>
151          * @param q A qualifying member
152          * @param mid The ID of the member to construct
153          * @since 1.0
154          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
155          */
156         public Member(JsObject.Member q, Mid mid) {
157             super(q, mid);
158         }
159         /**
160          * <p>Internally constructs a member without a qualifying member.</p>
161          * <p>This constructor is <b>internal</b> and only called inside of <b>opaque</b>
162          * or <b>internal</b> classes or class members.</p>
163          * <p>Note that, this constructor is <b>internal</b> but its declaring class is
164          * <b>opaque</b>. This constructor is used to define <b>opaque</b> static fields, 
165          * declared in <b>opaque</b> types other than the declaring class of this constructor 
166          * itself and its subclasses. Under this circumstance, the field names must be
167          * exactly same as the member names, as the <b>opaque</b> static fields of <b>opaque</b>
168          * types are generally resolved by re-compilers directly to identifiers of their names.</p>
169          * @param mid The ID of the member to construct
170          * @since 1.0
171          * @javascript Re-compilers must report error on the invocation to an <b>internal</b> constructor.
172          */
173         public Member(Mid mid) {
174             super(mid);
175         }
176         @Override
177         /**
178          * <p>Evaluates the property, represented by the current member instance, of the
179          * argument object.</p>
180          * @param o The argument object
181          * @return The value of the current member based on the object argument.
182          * @since 1.0
183          * @javascript Re-compilers must convert the instance invocation of this method into
184          * the JavaScript expression: 
185          * <pre>o.m</pre>
186          * where <tt>m</tt> is the identifier name resolved from the current member
187          * instance of the invocation.
188          */
189         public JsHTMLTableColElement with(ObjectLike o) {
190             return new JsHTMLTableColElement(super.with(o));
191         }
192 
193         /**
194          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
195          * name of this field, qualified by the current member instance of the field, and 
196          * to access the property of the name on an object.</p>
197          * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
198          * object refers to a string specifying the horizontal alignment of the elements 
199          * of the table column with respect to the surrounding context. Possible values 
200          * are:
201          * <ul>
202          * <li><tt>"left"</tt>: text lines are rendered flush left.</li>
203          * <li><tt>"center"</tt>: text lines are centered.</li>
204          * <li><tt>"right"</tt>: text lines are rendered flush right.</li>
205          * <li><tt>"justify"</tt>: text lines are justified to both margins.</li>
206          * </ul>
207          * The default value of this attribute depends on the base text direction. 
208          * For left to right text, the default is "left", while for right to left text, 
209          * it is "right".</p>
210          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
211          * @since 1.0
212          * @javascript Re-compilers must resolve the member of this instance field to the
213          * identifier of the field name appending to the identifier resolved from its 
214          * qualifying member with a dot in between.
215          */
216         public final Value.String.Member align  = new Value.String.Member(this, Members.align );
217         /**
218          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
219          * name of this field, qualified by the current member instance of the field, and 
220          * to access the property of the name on an object.</p>
221          * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
222          * object refers to a string specifying a single character within a text fragment 
223          * to act as an axis for alignment. The default value for this attribute is the 
224          * decimal point character for the current language as set by the {@link JsHTMLElement#lang} 
225          * attribute, e.g., the period (".") in English and the comma (",") in French. 
226          * Browsers are not required to support this attribute by HTML 4.01.</p>
227          * @since 1.0
228          * @javascript Re-compilers must resolve the member of this instance field to the
229          * identifier of the field name appending to the identifier resolved from its 
230          * qualifying member with a dot in between.
231          */
232         public final Value.String.Member ch     = new Value.String.Member(this, Members.ch    );
233         /**
234          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
235          * name of this field, qualified by the current member instance of the field, and 
236          * to access the property of the name on an object.</p>
237          * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
238          * object refers to a string specifying, if specified, the offset to the first 
239          * occurrence of the alignment character on each line. If a line doesn't include 
240          * the alignment character, it should be horizontally shifted to end at the 
241          * alignment position.</p>
242          * @since 1.0
243          * @javascript Re-compilers must resolve the member of this instance field to the
244          * identifier of the field name appending to the identifier resolved from its 
245          * qualifying member with a dot in between.
246          */
247         public final Value.String.Member chOff  = new Value.String.Member(this, Members.chOff );
248         /**
249          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
250          * name of this field, qualified by the current member instance of the field, and 
251          * to access the property of the name on an object.</p>
252          * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
253          * object refers to an integer value greater than 0 specifying the number of columns 
254          * spanned by this column. The default value for this attribute is 1, that is, 
255          * this column element refers to a single column. If the attribute is set to N 
256          * greater than 1, the current column element shares its attributes with the 
257          * next N-1 columns.</p>
258          * @since 1.0
259          * @javascript Re-compilers must resolve the member of this instance field to the
260          * identifier of the field name appending to the identifier resolved from its 
261          * qualifying member with a dot in between.
262          */
263         public final Value.String.Member span   = new Value.String.Member(this, Members.span  );
264         /**
265          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
266          * name of this field, qualified by the current member instance of the field, and 
267          * to access the property of the name on an object.</p>
268          * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
269          * object refers to a string specifying the vertical position of data within a 
270          * table column. Possible values are:
271          * <ul>
272          * <li><tt>"top"</tt>: Cell data is flush with the top of the cell.</li>
273          * <li><tt>"middle"</tt>: Cell data is centered vertically within the cell. This is the default value.</li>
274          * <li><tt>"bottom"</tt>: Cell data is flush with the bottom of the cell.</li>
275          * <li><tt>"baseline"</tt>: All cells in the same row as a cell whose {@link #vAlign} 
276          * attribute has this value should have their textual data positioned so that 
277          * the first text line occurs on a baseline common to all cells in the row. 
278          * This constraint does not apply to subsequent text lines in these cells.</li>
279          * </ul></p>
280          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
281          * @since 1.0
282          * @javascript Re-compilers must resolve the member of this instance field to the
283          * identifier of the field name appending to the identifier resolved from its 
284          * qualifying member with a dot in between.
285          */
286         public final Value.String.Member vAlign = new Value.String.Member(this, Members.vAlign);
287         /**
288          * <p>An <b>opaque</b> instance field defining a sub-member that is named by the
289          * name of this field, qualified by the current member instance of the field, and 
290          * to access the property of the name on an object.</p>
291          * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
292          * object refers to a string specifying the width the current table column.</p>
293          * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
294          * @since 1.0
295          * @javascript Re-compilers must resolve the member of this instance field to the
296          * identifier of the field name appending to the identifier resolved from its 
297          * qualifying member with a dot in between.
298          */
299         public final Value.String.Member width  = new Value.String.Member(this, Members.width );
300     }
301 
302     /**
303      * <p>Casts an <b>opaque</b> object to the current <b>opaque</b> type by wrapping it
304      * with the wrapping constructor.</p>
305      * @param var The argument of an <b>opaque</b> object.
306      * @since 1.0
307      * @javascript Re-compilers must ignore the construction operation of this constructor,
308      * that is, replacing it with its only argument.
309      */
310     public JsHTMLTableColElement(JsObject var) {
311         super(var);
312     }
313 
314     /**
315      * <p>An <b>opaque</b> static field defining a member that is named by the field name
316      * without a qualifying member and to access the property of the name on an object.</p>
317      * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
318      * object refers to a string specifying the horizontal alignment of the elements 
319      * of the table column with respect to the surrounding context. Possible values 
320      * are:
321      * <ul>
322      * <li><tt>"left"</tt>: text lines are rendered flush left.</li>
323      * <li><tt>"center"</tt>: text lines are centered.</li>
324      * <li><tt>"right"</tt>: text lines are rendered flush right.</li>
325      * <li><tt>"justify"</tt>: text lines are justified to both margins.</li>
326      * </ul>
327      * The default value of this attribute depends on the base text direction. 
328      * For left to right text, the default is "left", while for right to left text, 
329      * it is "right".</p>
330      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
331      * @since 1.0
332      * @javascript Re-compilers must resolve the member of this static field to the
333      * identifier of the field name.
334      */
335     public static final Value.String.Member align  = new Value.String.Member(Members.align );
336     /**
337      * <p>An <b>opaque</b> static field defining a member that is named by the field name
338      * without a qualifying member and to access the property of the name on an object.</p>
339      * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
340      * object refers to a string specifying a single character within a text fragment 
341      * to act as an axis for alignment. The default value for this attribute is the 
342      * decimal point character for the current language as set by the {@link JsHTMLElement#lang} 
343      * attribute, e.g., the period (".") in English and the comma (",") in French. 
344      * Browsers are not required to support this attribute by HTML 4.01.</p>
345      * @since 1.0
346      * @javascript Re-compilers must resolve the member of this static field to the
347      * identifier of the field name.
348      */
349     public static final Value.String.Member ch     = new Value.String.Member(Members.ch    );
350     /**
351      * <p>An <b>opaque</b> static field defining a member that is named by the field name
352      * without a qualifying member and to access the property of the name on an object.</p>
353      * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
354      * object refers to a string specifying, if specified, the offset to the first 
355      * occurrence of the alignment character on each line. If a line doesn't include 
356      * the alignment character, it should be horizontally shifted to end at the 
357      * alignment position.</p>
358      * @since 1.0
359      * @javascript Re-compilers must resolve the member of this static field to the
360      * identifier of the field name.
361      */
362     public static final Value.String.Member chOff  = new Value.String.Member(Members.chOff );
363     /**
364      * <p>An <b>opaque</b> static field defining a member that is named by the field name
365      * without a qualifying member and to access the property of the name on an object.</p>
366      * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
367      * object refers to an integer value greater than 0 specifying the number of columns 
368      * spanned by this column. The default value for this attribute is 1, that is, 
369      * this column element refers to a single column. If the attribute is set to N 
370      * greater than 1, the current column element shares its attributes with the 
371      * next N-1 columns.</p>
372      * @since 1.0
373      * @javascript Re-compilers must resolve the member of this static field to the
374      * identifier of the field name.
375      */
376     public static final Value.String.Member span   = new Value.String.Member(Members.span  );
377     /**
378      * <p>An <b>opaque</b> static field defining a member that is named by the field name
379      * without a qualifying member and to access the property of the name on an object.</p>
380      * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
381      * object refers to a string specifying the vertical position of data within a 
382      * table column. Possible values are:
383      * <ul>
384      * <li><tt>"top"</tt>: Cell data is flush with the top of the cell.</li>
385      * <li><tt>"middle"</tt>: Cell data is centered vertically within the cell. This is the default value.</li>
386      * <li><tt>"bottom"</tt>: Cell data is flush with the bottom of the cell.</li>
387      * <li><tt>"baseline"</tt>: All cells in the same row as a cell whose {@link #vAlign} 
388      * attribute has this value should have their textual data positioned so that 
389      * the first text line occurs on a baseline common to all cells in the row. 
390      * This constraint does not apply to subsequent text lines in these cells.</li>
391      * </ul></p>
392      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
393      * @since 1.0
394      * @javascript Re-compilers must resolve the member of this static field to the
395      * identifier of the field name.
396      */
397     public static final Value.String.Member vAlign = new Value.String.Member(Members.vAlign);
398     /**
399      * <p>An <b>opaque</b> static field defining a member that is named by the field name
400      * without a qualifying member and to access the property of the name on an object.</p>
401      * <p>The property, identified by this member, of a {@link JsHTMLTableColElement} 
402      * object refers to a string specifying the width the current table column.</p>
403      * <p>This attribute is deprecated by HTML 4.01 and should be handled by style sheets.</p> 
404      * @since 1.0
405      * @javascript Re-compilers must resolve the member of this static field to the
406      * identifier of the field name.
407      */
408     public static final Value.String.Member width  = new Value.String.Member(Members.width );
409 
410     @Override
411     /**
412      * <p>Returns the primitive value associated with the current instance, if there is one.
413      * This invocation simply returns the instance itself for the current instance is an 
414      * object and there is no primitive value for it.</p>
415      * @return The current object itself.
416      * @since 1.0
417      * @javascript Re-compilers must convert the instance invocation of this method directly
418      * into a JavaScript invocation on its current object instance without changing the 
419      * method name, but expanding variable arguments, if any, into comma-separated values. 
420      */
421     public final JsHTMLTableColElement valueOf() {
422         return new JsHTMLTableColElement((JsObject)var().valueOf());
423     }
424 }