01: /*
02: * $Id: CSSLookAndFeel.java 3059 2006-11-14 20:41:26Z cjschyma $
03: * Copyright 2000,2005 wingS development team.
04: *
05: * This file is part of wingS (http://wingsframework.org).
06: *
07: * wingS is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU Lesser General Public License
09: * as published by the Free Software Foundation; either version 2.1
10: * of the License, or (at your option) any later version.
11: *
12: * Please see COPYING for the complete licence.
13: */
14:
15: package org.wingx.plaf.css.msie;
16:
17: import org.wings.SComponent;
18: import org.wings.SIcon;
19: import org.wings.SResourceIcon;
20: import org.wings.io.Device;
21: import org.wings.plaf.css.Utils;
22:
23: import java.io.IOException;
24:
25: public class ColorPickerCG extends org.wingx.plaf.css.ColorPickerCG {
26:
27: private final SIcon icon = new SResourceIcon(
28: "org/wings/icons/pickerbg.png");
29:
30: /**
31: * Specialized CG to support transparent PNGs for IE < 7.
32: */
33: public ColorPickerCG() {
34: headers
35: .set(
36: 0,
37: Utils
38: .createExternalizedCSSHeader("org/wingx/colorpicker/hsvcolorpicker_lt_ie7.css"));
39: }
40:
41: @Override
42: protected void printPicker(Device device, SComponent component)
43: throws IOException {
44: device.print("<div");
45: Utils.optAttribute(device, "id", (String) component
46: .getClientProperty("pickerId"));
47: Utils.optAttribute(device, "class", "hsvcolorpicker pickerDiv");
48: device.print(">");
49: device.print("<div");
50: Utils.optAttribute(device, "class", "hsvcolorpicker pickerbg");
51: Utils.optAttribute(device, "style",
52: "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"
53: + icon.getURL() + "', sizingMethod='scale')");
54: device.print("></div>");
55: device.print("<div");
56: Utils.optAttribute(device, "id", (String) component
57: .getClientProperty("selectorId"));
58: Utils.optAttribute(device, "class", "hsvcolorpicker selector");
59: device.print("></div>");
60: device.print("</div>");
61: }
62:
63: @Override
64: public void installCG(final SComponent comp) {
65: super.installCG(comp);
66: comp.addParentFrameListener(this);
67: }
68:
69: }
|