File tree Expand file tree Collapse file tree
src/de/inetsoftware/jwebassembly/web/dom Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2020 Volker Berlin (i-net software)
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+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package de .inetsoftware .jwebassembly .web .dom ;
17+
18+ /**
19+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement
20+ *
21+ * @author Volker Berlin
22+ */
23+ public class HTMLAnchorElement extends HTMLElement {
24+
25+ /**
26+ * Create a Java instance as wrapper of the DOM object.
27+ *
28+ * @param peer
29+ * the native DOM object
30+ */
31+ HTMLAnchorElement ( Object peer ) {
32+ super ( peer );
33+ }
34+
35+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2020 Volker Berlin (i-net software)
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+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package de .inetsoftware .jwebassembly .web .dom ;
17+
18+ /**
19+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement
20+ *
21+ * @author Volker Berlin
22+ */
23+ public class HTMLAreaElement extends HTMLElement {
24+
25+ /**
26+ * Create a Java instance as wrapper of the DOM object.
27+ *
28+ * @param peer
29+ * the native DOM object
30+ */
31+ HTMLAreaElement ( Object peer ) {
32+ super ( peer );
33+ }
34+
35+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2020 Volker Berlin (i-net software)
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+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package de .inetsoftware .jwebassembly .web .dom ;
17+
18+ /**
19+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement
20+ *
21+ * @author Volker Berlin
22+ */
23+ public class HTMLCanvasElement extends HTMLElement {
24+
25+ /**
26+ * Create a Java instance as wrapper of the DOM object.
27+ *
28+ * @param peer
29+ * the native DOM object
30+ */
31+ HTMLCanvasElement ( Object peer ) {
32+ super ( peer );
33+ }
34+
35+ }
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2020 Volker Berlin (i-net software)
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+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+ package de .inetsoftware .jwebassembly .web .dom ;
17+
18+ /**
19+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement
20+ *
21+ * @author Volker Berlin
22+ */
23+ public class HTMLDivElement extends HTMLElement {
24+
25+ /**
26+ * Create a Java instance as wrapper of the DOM object.
27+ *
28+ * @param peer
29+ * the native DOM object
30+ */
31+ HTMLDivElement ( Object peer ) {
32+ super ( peer );
33+ }
34+
35+ }
Original file line number Diff line number Diff line change 2323public class HTMLElement extends Element {
2424
2525 /**
26- * Create a Java instance as wrapper of the JavaScript object.
26+ * Create a Java instance as wrapper of the DOM object.
2727 *
2828 * @param peer
29- * the native JavaScript object
29+ * the native DOM object
3030 */
3131 HTMLElement ( Object peer ) {
3232 super ( peer );
3333 }
34+
35+ /**
36+ * Create a wrapper for a HTML peer element.
37+ *
38+ * @param tagName
39+ * the tag name of the element
40+ * @param peer
41+ * the native DOM object
42+ * @return the wrapper
43+ */
44+ static HTMLElement createWrapper ( String tagName , Object peer ) {
45+ switch ( tagName ) {
46+ case "a" :
47+ return new HTMLAnchorElement ( peer );
48+ case "area" :
49+ return new HTMLAreaElement ( peer );
50+ case "canvas" :
51+ return new HTMLCanvasElement ( peer );
52+ case "div" :
53+ return new HTMLDivElement ( peer );
54+ default :
55+ return new HTMLElement ( peer );
56+ }
57+ }
3458}
You can’t perform that action at this time.
0 commit comments