1 21 24 package org.lobobrowser.html.renderer; 25 26 import java.awt.Graphics ; 27 import java.io.File ; 28 29 import org.lobobrowser.html.domimpl.*; 30 31 abstract class BaseInputControl extends BaseControl implements InputContext { 32 protected String value; 33 34 public BaseInputControl(HTMLBaseInputElement modelNode) { 35 super(modelNode); 36 this.setOpaque(false); 37 } 38 39 public void reset(int availWidth, int availHeight) { 40 String sizeText = this.controlElement.getAttribute("size"); 41 if(sizeText != null) { 42 try { 43 this.size = Integer.parseInt(sizeText); 44 } catch(NumberFormatException nfe) { 45 } 47 } 48 } 49 50 public int getVAlign() { 51 return RElement.VALIGN_ABSBOTTOM; 52 } 53 54 protected int size = -1; 55 56 59 public void blur() { 60 } 61 62 65 public void click() { 66 } 67 68 71 public void focus() { 72 this.requestFocus(); 73 } 74 75 78 public boolean getChecked() { 79 return false; 80 } 81 82 85 public boolean getDisabled() { 86 return !this.isEnabled(); 87 } 88 89 92 public int getMaxLength() { 93 return 0; 94 } 95 96 99 public boolean getReadOnly() { 100 return false; 101 } 102 103 106 public int getTabIndex() { 107 return 0; 108 } 109 110 113 public String getValue() { 114 return this.value; 115 } 116 117 120 public void select() { 121 } 122 123 126 public void setChecked(boolean checked) { 127 } 128 129 132 public void setDisabled(boolean disabled) { 133 this.setEnabled(!disabled); 134 } 135 136 139 public void setMaxLength(int maxLength) { 140 } 141 142 145 public void setReadOnly(boolean readOnly) { 146 } 147 148 151 public void setControlSize(int size) { 152 this.size = size; 153 this.invalidate(); 154 } 155 156 159 public void setTabIndex(int tabIndex) { 160 } 161 162 165 public void setValue(String value) { 166 this.value = value; 167 } 168 169 172 public int getControlSize() { 173 return this.size; 174 } 175 176 179 public int getCols() { 180 return 0; 181 } 182 183 186 public int getRows() { 187 return 0; 188 } 189 190 193 public void setCols(int cols) { 194 } 195 196 199 public void setRows(int rows) { 200 } 201 202 205 public boolean paintSelection(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) { 206 return inSelection; 207 } 208 209 public boolean getMultiple() { 210 return false; 212 } 213 214 public int getSelectedIndex() { 215 return -1; 217 } 218 219 public int getVisibleSize() { 220 return 0; 222 } 223 224 public void setMultiple(boolean value) { 225 } 227 228 public void setSelectedIndex(int value) { 229 } 231 232 public void setVisibleSize(int value) { 233 } 235 236 public File getFileValue() { 237 return null; 239 } 240 } 241 | Popular Tags |