1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.htmlunit.javascript.host.html;
16
17 import org.htmlunit.html.HtmlDirectory;
18 import org.htmlunit.javascript.JavaScriptEngine;
19 import org.htmlunit.javascript.configuration.JsxClass;
20 import org.htmlunit.javascript.configuration.JsxConstructor;
21 import org.htmlunit.javascript.configuration.JsxGetter;
22 import org.htmlunit.javascript.configuration.JsxSetter;
23
24
25
26
27
28
29
30
31 @JsxClass(domClass = HtmlDirectory.class)
32 public class HTMLDirectoryElement extends HTMLElement {
33
34
35
36
37 @Override
38 @JsxConstructor
39 public void jsConstructor() {
40 super.jsConstructor();
41 }
42
43
44
45
46
47 @JsxGetter
48 public boolean isCompact() {
49 return getDomNodeOrDie().hasAttribute("compact");
50 }
51
52
53
54
55
56 @JsxSetter
57 public void setCompact(final Object compact) {
58 if (JavaScriptEngine.toBoolean(compact)) {
59 getDomNodeOrDie().setAttribute("compact", "");
60 }
61 else {
62 getDomNodeOrDie().removeAttribute("compact");
63 }
64 }
65 }