1 21 24 package org.lobobrowser.html.domimpl; 25 26 import org.lobobrowser.html.style.*; 27 import org.w3c.dom.html2.HTMLTableCellElement; 28 29 public class HTMLTableCellElementImpl extends HTMLAbstractUIElement implements 30 HTMLTableCellElement { 31 public HTMLTableCellElementImpl(String name) { 32 super(name); 33 } 34 35 public int getCellIndex() { 36 return 0; 38 } 39 40 public String getAbbr() { 41 return this.getAttribute("abbr"); 42 } 43 44 public void setAbbr(String abbr) { 45 this.setAttribute("abbr", abbr); 46 } 47 48 public String getAlign() { 49 return this.getAttribute("align"); 50 } 51 52 public void setAlign(String align) { 53 this.setAttribute("align", align); 54 } 55 56 public String getAxis() { 57 return this.getAttribute("axis"); 58 } 59 60 public void setAxis(String axis) { 61 this.setAttribute("axis", axis); 62 } 63 64 public String getBgColor() { 65 return this.getAttribute("bgcolor"); 66 } 67 68 public void setBgColor(String bgColor) { 69 this.setAttribute("bgcolor", bgColor); 70 } 71 72 public String getCh() { 73 return this.getAttribute("ch"); 74 } 75 76 public void setCh(String ch) { 77 this.setAttribute("ch", ch); 78 } 79 80 public String getChOff() { 81 return this.getAttribute("choff"); 82 } 83 84 public void setChOff(String chOff) { 85 this.setAttribute("choff", chOff); 86 } 87 88 public int getColSpan() { 89 String colSpanText = this.getAttribute("colspan"); 90 if(colSpanText == null) { 91 return 1; 92 } 93 else { 94 try { 95 return Integer.parseInt(colSpanText); 96 } catch(NumberFormatException nfe) { 97 return 1; 98 } 99 } 100 } 101 102 public void setColSpan(int colSpan) { 103 this.setAttribute("colspan", String.valueOf(colSpan)); 104 } 105 106 public String getHeaders() { 107 return this.getAttribute("headers"); 108 } 109 110 public void setHeaders(String headers) { 111 this.setAttribute("headers", headers); 112 } 113 114 public String getHeight() { 115 return this.getAttribute("height"); 116 } 117 118 public void setHeight(String height) { 119 this.setAttribute("height", height); 120 } 121 122 public boolean getNoWrap() { 123 return "nowrap".equalsIgnoreCase(this.getAttribute("nowrap")); 124 } 125 126 public void setNoWrap(boolean noWrap) { 127 this.setAttribute("nowrap", noWrap ? "nowrap" : null); 128 } 129 130 public int getRowSpan() { 131 String rowSpanText = this.getAttribute("rowspan"); 132 if(rowSpanText == null) { 133 return 1; 134 } 135 else { 136 try { 137 return Integer.parseInt(rowSpanText); 138 } catch(NumberFormatException nfe) { 139 return 1; 140 } 141 } 142 } 143 144 public void setRowSpan(int rowSpan) { 145 this.setAttribute("rowspan", String.valueOf(rowSpan)); 146 } 147 148 public String getScope() { 149 return this.getAttribute("scope"); 150 } 151 152 public void setScope(String scope) { 153 this.setAttribute("scope", scope); 154 } 155 156 public String getVAlign() { 157 return this.getAttribute("valign"); 158 } 159 160 public void setVAlign(String vAlign) { 161 this.setAttribute("valign", vAlign); 162 } 163 164 public String getWidth() { 165 return this.getAttribute("width"); 166 } 167 168 public void setWidth(String width) { 169 this.setAttribute("width", width); 170 } 171 172 protected RenderState createRenderState(RenderState prevRenderState) { 173 return new TableCellRenderState(prevRenderState, this); 174 } 175 } 176 | Popular Tags |