1 21 24 package org.lobobrowser.html.domimpl; 25 26 import org.lobobrowser.html.style.*; 27 import org.w3c.dom.html2.HTMLOListElement; 28 29 public class HTMLOListElementImpl extends HTMLAbstractUIElement implements 30 HTMLOListElement { 31 public HTMLOListElementImpl(String name) { 32 super(name); 33 } 34 35 public boolean getCompact() { 36 String compactText = this.getAttribute("compact"); 37 return "compact".equalsIgnoreCase(compactText); 38 } 39 40 public void setCompact(boolean compact) { 41 this.setAttribute("compact", compact ? "compact" : null); 42 } 43 44 public int getStart() { 45 String startText = this.getAttribute("start"); 46 if(startText == null) { 47 return 1; 48 } 49 try { 50 return Integer.parseInt(startText); 51 } catch(NumberFormatException nfe) { 52 return 1; 53 } 54 } 55 56 public void setStart(int start) { 57 this.setAttribute("start", String.valueOf(start)); 58 } 59 60 public String getType() { 61 return this.getAttribute("type"); 62 } 63 64 public void setType(String type) { 65 this.setAttribute("type", type); 66 } 67 68 protected RenderState createRenderState(RenderState prevRenderState) { 69 return new DisplayRenderState(prevRenderState, this, RenderState.DISPLAY_LIST_ITEM); 70 } 71 } 72 | Popular Tags |