Source Code Cross Referenced for CmsTableCG.java in  » Swing-Library » wings3 » org » wings » plaf » 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 
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;
014:
015:        import org.wings.plaf.css.Utils;
016:        import org.wings.*;
017:        import org.wings.table.STableCellRenderer;
018:        import org.wings.io.Device;
019:        import org.wings.macro.MacroContext;
020:        import org.wings.macro.MacroContainer;
021:        import org.wings.macro.MacroTag;
022:
023:        import java.io.IOException;
024:        import java.util.List;
025:        import java.awt.*;
026:
027:        /**
028:         * <code>CmsTableCG<code>.
029:         * <p/>
030:         * User: raedler
031:         * Date: 10.08.2007
032:         * Time: 13:23:45
033:         *
034:         * @author raedler
035:         * @version $Id
036:         */
037:        public class CmsTableCG implements  TableCG, CmsCG {
038:
039:            private MacroContainer macros;
040:
041:            /**
042:             * {@inheritDoc}
043:             */
044:            public void setMacros(MacroContainer macros) {
045:                this .macros = macros;
046:            }
047:
048:            /**
049:             * {@inheritDoc}
050:             */
051:            public Update getTableCellUpdate(STable table, int row, int col) {
052:                // can be ignored at the moment
053:                return null;
054:            }
055:
056:            /**
057:             * {@inheritDoc}
058:             */
059:            public void installCG(SComponent c) {
060:                // ignore
061:            }
062:
063:            /**
064:             * {@inheritDoc}
065:             */
066:            public void uninstallCG(SComponent c) {
067:                // ignore
068:            }
069:
070:            /**
071:             * {@inheritDoc}
072:             */
073:            public void componentChanged(SComponent c) {
074:                // can be ignored at the moment
075:            }
076:
077:            /**
078:             * {@inheritDoc}
079:             */
080:            public void write(Device device, SComponent component)
081:                    throws IOException {
082:                macros.execute();
083:            }
084:
085:            public void writeTableEvent(Device device, SComponent component)
086:                    throws IOException {
087:                System.out.println("CmsTableCG.writeTableEvent");
088:
089:                Utils.writeEvents(device, component, null);
090:            }
091:
092:            public void writeCellEvent(Device device, SComponent _c,
093:                    Integer row, Integer col) throws IOException {
094:                System.out.println("CmsTableCG.writeCellEvent");
095:
096:                STable table = (STable) _c;
097:
098:                final boolean isEditingCell = table.isEditing()
099:                        && row == table.getEditingRow()
100:                        && col == table.getEditingColumn();
101:                final boolean editableCell = table.isCellEditable(row, col);
102:                final boolean selectableCell = table.getSelectionMode() != SListSelectionModel.NO_SELECTION
103:                        && !table.isEditable() && table.isSelectable();
104:
105:                final SComponent component;
106:                if (isEditingCell) {
107:                    component = table.getEditorComponent();
108:                } else {
109:                    STableCellRenderer renderer = table.getCellRenderer(row
110:                            .intValue(), col.intValue());
111:                    if (renderer != null) {
112:                        component = table.prepareRenderer(renderer, row
113:                                .intValue(), col.intValue());
114:                    } else {
115:                        device.print(table.getValueAt(row.intValue(), col
116:                                .intValue()));
117:                        return;
118:                    }
119:                }
120:
121:                final boolean isClickable = component instanceof  SClickable;
122:
123:                String parameter = null;
124:                if (table.isEditable() && !isEditingCell && editableCell)
125:                    parameter = table.getEditParameter(row.intValue(), col
126:                            .intValue());
127:                else if (selectableCell)
128:                    parameter = table.getToggleSelectionParameter(row
129:                            .intValue(), col.intValue());
130:
131:                if (parameter != null && !isEditingCell
132:                        && (selectableCell || editableCell) && !isClickable) {
133:                    Utils.printClickability(device, table, parameter, true,
134:                            table.getShowAsFormComponent());
135:                }
136:            }
137:
138:            /**
139:             * {@inheritDoc}
140:             */
141:            public Update getComponentUpdate(SComponent component) {
142:                // can be ignored at the moment
143:                return null;
144:            }
145:
146:            public Update getTableScrollUpdate(STable table,
147:                    Rectangle newViewport, Rectangle oldViewport) {
148:                return null;
149:            }
150:
151:            public Update getSelectionUpdate(STable table,
152:                    List deselectedIndices, List selectedIndices) {
153:                return null;
154:            }
155:
156:            public Update getEditCellUpdate(STable sTable, int row, int column) {
157:                return null;
158:            }
159:
160:            public Update getRenderCellUpdate(STable sTable, int row, int column) {
161:                return null;
162:            }
163:
164:            @MacroTag
165:            public void id(MacroContext context) throws IOException {
166:                context.getDevice().print(
167:                        "id=\"" + context.getComponent().getName() + "\"");
168:            }
169:
170:            @MacroTag
171:            public void toggleSelection(MacroContext context, int row)
172:                    throws IOException {
173:                context
174:                        .getDevice()
175:                        .print(
176:                                "wingS.request.sendEvent(event,true,true,'c','t"
177:                                        + row
178:                                        + ":0;shiftKey='+event.shiftKey+';ctrlKey='+event.ctrlKey+''); return false;");
179:            }
180:
181:            @MacroTag
182:            public void cell(MacroContext context, int row, int col)
183:                    throws IOException {
184:                throw new UnsupportedOperationException(
185:                        "Currently not supported.");
186:                /*
187:                Device device = context.getDevice();
188:                SComponent component = context.getComponent();
189:
190:                RenderHelper.getInstance(component).forbidCaching();
191:
192:                STable table = (STable) component;
193:                STableCellRenderer renderer = table.getCellRenderer(row, col);
194:
195:                if (renderer != null) {
196:                    SComponent cellComponent = table.prepareRenderer(renderer, row, col);
197:                    SCellRendererPane rendererPane = table.getCellRendererPane();
198:                    rendererPane.writeComponent(device, cellComponent, table);
199:                } else {
200:                    device.print(table.getValueAt(row, col));
201:                }
202:                RenderHelper.getInstance(component).allowCaching();
203:                 */
204:            }
205:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.