1 /*
2 * Copyright (c) 2002-2025 Gargoyle Software Inc.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * https://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15 package org.htmlunit.javascript.host.html;
16
17 import org.htmlunit.javascript.configuration.JsxClass;
18 import org.htmlunit.javascript.configuration.JsxGetter;
19 import org.htmlunit.javascript.configuration.JsxSetter;
20
21 /**
22 * Contains attributes common to various table components.
23 *
24 * @author Daniel Gredler
25 */
26 @JsxClass(isJSObject = false)
27 public class HTMLTableComponent extends HTMLElement {
28
29 /** The default value of the "vAlign" property. */
30 private static final String VALIGN_DEFAULT_VALUE = "top";
31
32 /**
33 * Returns the value of the {@code align} property.
34 * @return the value of the {@code align} property
35 */
36 @JsxGetter
37 public String getAlign() {
38 return getAlign(true);
39 }
40
41 /**
42 * Sets the value of the {@code align} property.
43 * @param align the value of the {@code align} property
44 */
45 @JsxSetter
46 public void setAlign(final String align) {
47 setAlign(align, false);
48 }
49
50 /**
51 * Returns the value of the {@code vAlign} property.
52 * @return the value of the {@code vAlign} property
53 */
54 @JsxGetter
55 public String getVAlign() {
56 return getVAlign(getValidVAlignValues(), VALIGN_DEFAULT_VALUE);
57 }
58
59 /**
60 * Sets the value of the {@code vAlign} property.
61 * @param vAlign the value of the {@code vAlign} property
62 */
63 @JsxSetter
64 public void setVAlign(final Object vAlign) {
65 setVAlign(vAlign, getValidVAlignValues());
66 }
67
68 /**
69 * Returns the valid "vAlign" values for this element, depending on the browser being emulated.
70 * @return the valid "vAlign" values for this element, depending on the browser being emulated
71 */
72 private String[] getValidVAlignValues() {
73 return null;
74 }
75
76 /**
77 * Returns the value of the {@code ch} property.
78 * @return the value of the {@code ch} property
79 */
80 @Override
81 @JsxGetter
82 public String getCh() {
83 return super.getCh();
84 }
85
86 /**
87 * Sets the value of the {@code ch} property.
88 * @param ch the value of the {@code ch} property
89 */
90 @Override
91 @JsxSetter
92 public void setCh(final String ch) {
93 super.setCh(ch);
94 }
95
96 /**
97 * Returns the value of the {@code chOff} property.
98 * @return the value of the {@code chOff} property
99 */
100 @Override
101 @JsxGetter
102 public String getChOff() {
103 return super.getChOff();
104 }
105
106 /**
107 * Sets the value of the {@code chOff} property.
108 * @param chOff the value of the {@code chOff} property
109 */
110 @Override
111 @JsxSetter
112 public void setChOff(final String chOff) {
113 super.setChOff(chOff);
114 }
115
116 }