1 14 package org.wings.plaf.css; 15 16 17 import java.io.IOException ; 18 19 import org.wings.SAbstractButton; 20 import org.wings.SIcon; 21 import org.wings.io.Device; 22 23 public class RadioButtonCG extends CheckBoxCG implements 24 org.wings.plaf.RadioButtonCG { 25 protected void installIcons(final SAbstractButton button) { 26 org.wings.plaf.CGManager manager = button.getSession().getCGManager(); 27 button.setIcon((SIcon) manager.getObject("SRadioButton.icon", SIcon.class)); 28 button.setSelectedIcon((SIcon) manager.getObject("SRadioButton.selectedIcon", SIcon.class)); 29 button.setRolloverIcon((SIcon) manager.getObject("SRadioButton.rolloverIcon", SIcon.class)); 30 button.setRolloverSelectedIcon((SIcon) manager.getObject("SRadioButton.rolloverSelectedIcon", SIcon.class)); 31 button.setPressedIcon((SIcon) manager.getObject("SRadioButton.pressedIcon", SIcon.class)); 32 button.setDisabledIcon((SIcon) manager.getObject("SRadioButton.disabledIcon", SIcon.class)); 33 button.setDisabledSelectedIcon((SIcon) manager.getObject("SRadioButton.disabledSelectedIcon", SIcon.class)); 34 } 35 36 protected void inputTypeCheckbox(Device device, SAbstractButton button) throws IOException { 37 device.print("<input type=\"hidden\" name=\""); 38 Utils.write(device, Utils.event(button)); 39 device.print("\" value=\""); 40 Utils.write(device, button.getDeselectionParameter()); 41 device.print("\"/>"); 42 43 device.print("<input type=\"radio\" name=\""); 44 Utils.write(device, Utils.event(button)); 45 device.print("\" value=\""); 46 Utils.write(device, button.getToggleSelectionParameter()); 47 device.print("\""); 48 49 if (!button.isEnabled()) 50 device.print(" disabled=\"true\""); 51 if (button.isFocusOwner()) 52 Utils.optAttribute(device, "focus", button.getName()); 53 54 if (button.isSelected()) 55 device.print(" checked=\"true\""); 56 57 Utils.writeEvents(device, button); 58 device.print("/>"); 59 } 60 } 61 | Popular Tags |