Source Code Cross Referenced for RadioButtonCG.java in  » Swing-Library » wings3 » org » wings » plaf » css » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » wings3 » org.wings.plaf.css 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2000,2005 wingS development team.
003:         *
004:         * This file is part of wingS (http://wingsframework.org).
005:         *
006:         * wingS is free software; you can redistribute it and/or modify
007:         * it under the terms of the GNU Lesser General Public License
008:         * as published by the Free Software Foundation; either version 2.1
009:         * of the License, or (at your option) any later version.
010:         *
011:         * Please see COPYING for the complete licence.
012:         */
013:        package org.wings.plaf.css;
014:
015:        import org.wings.*;
016:        import org.wings.io.Device;
017:        import org.wings.plaf.Update;
018:        import org.wings.resource.ResourceManager;
019:
020:        import java.io.IOException;
021:        import org.wings.script.JavaScriptEvent;
022:        import org.wings.script.JavaScriptListener;
023:
024:        public final class RadioButtonCG extends CheckBoxCG implements 
025:                org.wings.plaf.RadioButtonCG {
026:            private static final long serialVersionUID = 1L;
027:
028:            protected void installIcons(final SAbstractButton button) {
029:                button.setIcon((SIcon) ResourceManager.getObject(
030:                        "SRadioButton.icon", SIcon.class));
031:                button.setSelectedIcon((SIcon) ResourceManager.getObject(
032:                        "SRadioButton.selectedIcon", SIcon.class));
033:                button.setRolloverIcon((SIcon) ResourceManager.getObject(
034:                        "SRadioButton.rolloverIcon", SIcon.class));
035:                button.setRolloverSelectedIcon((SIcon) ResourceManager
036:                        .getObject("SRadioButton.rolloverSelectedIcon",
037:                                SIcon.class));
038:                button.setPressedIcon((SIcon) ResourceManager.getObject(
039:                        "SRadioButton.pressedIcon", SIcon.class));
040:                button.setDisabledIcon((SIcon) ResourceManager.getObject(
041:                        "SRadioButton.disabledIcon", SIcon.class));
042:                button.setDisabledSelectedIcon((SIcon) ResourceManager
043:                        .getObject("SRadioButton.disabledSelectedIcon",
044:                                SIcon.class));
045:            }
046:
047:            protected void tableClickability(Device device,
048:                    SAbstractButton button) throws IOException {
049:                if (!button.isSelected()) {
050:                    super .tableClickability(device, button);
051:                }
052:            }
053:
054:            protected void writeInput(Device device, SAbstractButton button)
055:                    throws IOException {
056:                if (button.getShowAsFormComponent() && !useIconsInForms) {
057:                    Object clientProperty = button
058:                            .getClientProperty("onChangeSubmitListener");
059:                    // If the application developer attached any ActionListeners, ItemListeners or
060:                    // ChangeListeners to this SRadioButton or its ButtonGroup, the surrounding form
061:                    // gets submitted as soon as the state of this SRadioButton changed.
062:                    if (button.getActionListeners().length > 0
063:                            || button.getItemListeners().length > 0
064:                            || button.getChangeListeners().length > 0
065:                            || (button.getGroup() != null && button.getGroup()
066:                                    .getActionListeners().length > 0)) {
067:                        if (clientProperty == null) {
068:                            String event = JavaScriptEvent.ON_CHANGE;
069:                            String code = "wingS.request.sendEvent(event, true, "
070:                                    + !button.isReloadForced() + ");";
071:                            if (Utils.isMSIE(button)) {
072:                                // In IE the "onchange"-event gets fired when a control loses the
073:                                // input focus and its value has been modified since gaining focus.
074:                                // Even though this is actually the correct behavior, we want the
075:                                // event to get fired immediately - thats why we use a "filtered"
076:                                // version of IE's proprietary "onpropertychange"-event.
077:                                event = "onpropertychange";
078:                                code = "if (event.srcElement.checked) " + code;
079:                            }
080:                            JavaScriptListener javaScriptListener = new JavaScriptListener(
081:                                    event, code);
082:                            button.addScriptListener(javaScriptListener);
083:                            button.putClientProperty("onChangeSubmitListener",
084:                                    javaScriptListener);
085:                        }
086:                    } else if (clientProperty != null
087:                            && clientProperty instanceof  JavaScriptListener) {
088:                        button
089:                                .removeScriptListener((JavaScriptListener) clientProperty);
090:                        button
091:                                .putClientProperty("onChangeSubmitListener",
092:                                        null);
093:                    }
094:                }
095:
096:                device.print("<input type=\"hidden\" name=\"");
097:                Utils.write(device, Utils.event(button));
098:                device.print("\" value=\"");
099:                Utils.write(device, button.getDeselectionParameter());
100:                device.print("\"/>");
101:
102:                device.print("<input type=\"radio\" name=\"");
103:
104:                Utils.write(device, Utils.event(button));
105:                device.print("\" value=\"");
106:                Utils.write(device, button.getToggleSelectionParameter());
107:                device.print("\"");
108:                Utils.writeEvents(device, button, null);
109:                Utils.optAttribute(device, "tabindex", button
110:                        .getFocusTraversalIndex());
111:
112:                if (!button.isEnabled())
113:                    device.print(" disabled=\"true\"");
114:                if (button.isSelected())
115:                    device.print(" checked=\"true\"");
116:                if (button.isFocusOwner())
117:                    Utils.optAttribute(device, "foc", button.getName());
118:
119:                device.print("/>");
120:            }
121:
122:            public Update getTextUpdate(SRadioButton radioButton, String text) {
123:                return text == null ? null : new TextUpdate(radioButton, text);
124:            }
125:
126:            public Update getIconUpdate(SRadioButton radioButton, SIcon icon) {
127:                return icon == null ? null : new IconUpdate(radioButton, icon);
128:            }
129:
130:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.