1 21 24 package org.lobobrowser.html.domimpl; 25 26 import org.lobobrowser.html.style.*; 27 import org.w3c.dom.html2.HTMLLIElement; 28 29 public class HTMLLIElementImpl extends HTMLAbstractUIElement implements HTMLLIElement { 30 public HTMLLIElementImpl(String name) { 31 super(name); 32 } 33 34 public String getType() { 35 return this.getAttribute("type"); 36 } 37 38 public void setType(String type) { 39 this.setAttribute("type", type); 40 } 41 42 public int getValue() { 43 String valueText = this.getAttribute("value"); 44 if(valueText == null) { 45 return 0; 46 } 47 try { 48 return Integer.parseInt(valueText); 49 } catch(NumberFormatException nfe) { 50 return 0; 51 } 52 } 53 54 public void setValue(int value) { 55 this.setAttribute("value", String.valueOf(value)); 56 } 57 58 protected RenderState createRenderState(RenderState prevRenderState) { 59 return new DisplayRenderState(prevRenderState, this, RenderState.DISPLAY_LIST_ITEM); 60 } 61 } 62 | Popular Tags |