1 23 24 package com.sun.enterprise.tools.guiframework.view.descriptors; 25 26 import com.iplanet.jato.RequestContext; 27 import com.iplanet.jato.view.ContainerView; 28 import com.iplanet.jato.view.View; 29 import com.sun.web.ui.view.html.CCImageField; 30 31 32 35 public class CCImageFieldDescriptor extends DisplayFieldDescriptor { 36 37 40 public CCImageFieldDescriptor(String name) { 41 super(name); 42 } 43 44 80 public View getInstance(RequestContext ctx, ContainerView container, String name) { 81 CCImageField image = new CCImageField(container, name, getInitialValue()); 82 setBoundName(image); 83 84 String value = (String )getParameter(ALIGN); 86 if (value != null) { 87 image.setAlign(value); 88 } 89 90 value = (String )getParameter(ALT); 92 if (value != null) { 93 image.setAlt(value); 94 } 95 96 value = (String )getParameter(BORDER); 98 if (value != null) { 99 image.setBorder(Integer.parseInt(value)); 100 } 101 102 value = (String )getParameter(ELEMENT_ID); 104 if (value != null) { 105 image.setElementId(value); 106 } 107 108 value = (String )getParameter(HEIGHT); 110 if (value != null) { 111 image.setHeight(Integer.parseInt(value)); 112 } 113 114 value = (String )getParameter(HSPACE); 116 if (value != null) { 117 image.setHspace(Integer.parseInt(value)); 118 } 119 120 value = (String )getParameter(IS_MAP); 122 if (value != null) { 123 image.setIsMap(Boolean.valueOf(value).booleanValue()); 124 } 125 126 value = (String )getParameter(IS_MAP); 128 if (value != null) { 129 image.setLongDesc(value); 130 } 131 132 value = (String )getParameter(TITLE); 134 if (value != null) { 135 image.setTitle(value); 136 } 137 138 value = (String )getParameter(USE_MAP); 140 if (value != null) { 141 image.setUseMap(value); 142 } 143 144 value = (String )getParameter(VSPACE); 146 if (value != null) { 147 image.setVspace(Integer.parseInt(value)); 148 } 149 150 value = (String )getParameter(WIDTH); 152 if (value != null) { 153 image.setWidth(Integer.parseInt(value)); 154 } 155 156 return image; 157 } 158 159 163 public static final String ALIGN = "align"; 164 165 169 public static final String ALT = "alt"; 170 171 175 public static final String BORDER = "border"; 176 177 181 public static final String ELEMENT_ID = "elementId"; 182 183 187 public static final String HEIGHT = "height"; 188 189 193 public static final String HSPACE = "hspace"; 194 195 199 public static final String IS_MAP = "isMap"; 200 201 205 public static final String LONG_DESC = "longDesc"; 206 207 211 public static final String TITLE = "title"; 212 213 217 public static final String USE_MAP = "useMap"; 218 219 223 public static final String VSPACE = "vspace"; 224 225 229 public static final String WIDTH = "width"; 230 } 231 | Popular Tags |