Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2000,2005 wingS development team.
*
* This file is part of wingS (http://wingsframework.org).
*
* wingS is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* Please see COPYING for the complete licence.
*/
package org.wings.plaf.css;
import org.wings.*;
import org.wings.io.Device;
import org.wings.plaf.Update;
import org.wings.resource.ResourceManager;
import org.wings.script.JavaScriptEvent;
import org.wings.script.JavaScriptListener;
import java.io.IOException;
public class CheckBoxCG extends ButtonCG implements org.wings.plaf.CheckBoxCG {
private static final long serialVersionUID = 1L;
protected boolean useIconsInForms = false;
public boolean isUseIconsInForm() {
return useIconsInForms;
}
public void setUseIconsInForm(boolean useIconsInForm) {
this.useIconsInForms = useIconsInForm;
}
@Override
public void installCG(SComponent component) {
super.installCG(component);
final SAbstractButton button = (SAbstractButton) component;
installIcons(button);
}
protected void installIcons(final SAbstractButton button) {
button.setIcon((SIcon) ResourceManager.getObject("SCheckBox.icon", SIcon.class));
button.setSelectedIcon((SIcon) ResourceManager.getObject("SCheckBox.selectedIcon", SIcon.class));
button.setRolloverIcon((SIcon) ResourceManager.getObject("SCheckBox.rolloverIcon", SIcon.class));
button.setRolloverSelectedIcon((SIcon) ResourceManager.getObject("SCheckBox.rolloverSelectedIcon", SIcon.class));
button.setPressedIcon((SIcon) ResourceManager.getObject("SCheckBox.pressedIcon", SIcon.class));
button.setDisabledIcon((SIcon) ResourceManager.getObject("SCheckBox.disabledIcon", SIcon.class));
button.setDisabledSelectedIcon((SIcon) ResourceManager.getObject("SCheckBox.disabledSelectedIcon", SIcon.class));
}
@Override
public void writeInternal(final Device device, final SComponent component)
throws IOException {
final SAbstractButton button = (SAbstractButton) component;
final boolean showAsFormComponent = button.getShowAsFormComponent();
final String text = button.getText();
final SIcon icon = getIcon(button);
/*
// text only
if (icon == null && text != null && (!showAsFormComponent || useIconsInForms && showAsFormComponent)) {
device.print("