Source Code Cross Referenced for PatternBasedElementTableTreeNode.java in  » Ajax » ItsNat » org » itsnat » feashow » features » core » domutils » 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 » Ajax » ItsNat » org.itsnat.feashow.features.core.domutils 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is not part of the ItsNat framework.
003:         *
004:         * Original source code use and closed source derivatives are authorized
005:         * to third parties with no restriction or fee.
006:         * The original source code is owned by the author.
007:         *
008:         * This program is distributed AS IS in the hope that it will be useful,
009:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
010:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
011:         *
012:         * Author: Jose Maria Arranz Santamaria
013:         * (C) Innowhere Software Services S.L., Spanish company, year 2007
014:         */
015:
016:        package org.itsnat.feashow.features.core.domutils;
017:
018:        import org.itsnat.core.ItsNatDocument;
019:        import org.itsnat.core.domutil.ElementTable;
020:        import org.itsnat.core.domutil.ElementTableRenderer;
021:        import org.itsnat.core.domutil.ElementTableStructure;
022:        import org.itsnat.core.domutil.ItsNatDOMUtil;
023:        import org.itsnat.core.domutil.ItsNatTreeWalker;
024:        import org.itsnat.feashow.FeatureTreeNode;
025:        import org.w3c.dom.Document;
026:        import org.w3c.dom.Element;
027:        import org.w3c.dom.html.HTMLTableCellElement;
028:        import org.w3c.dom.html.HTMLTableElement;
029:        import org.w3c.dom.html.HTMLTableRowElement;
030:        import org.w3c.dom.html.HTMLTableSectionElement;
031:
032:        public class PatternBasedElementTableTreeNode extends FeatureTreeNode {
033:            public PatternBasedElementTableTreeNode() {
034:            }
035:
036:            public void startExamplePanel() {
037:
038:                buildTable("tableId", null, null);
039:
040:                ElementTableRenderer customRenderer = new ElementTableRenderer() {
041:                    public void renderTable(ElementTable table, int row,
042:                            int col, Object value, Element elem, boolean isNew) {
043:                        String style;
044:                        if (row == 0)
045:                            style = "font-style:italic;";
046:                        else if (row == 1)
047:                            style = "font-weight:bold;";
048:                        else
049:                            style = "font-size:large;";
050:                        elem.setAttribute("style", style);
051:                        ItsNatDOMUtil.setTextContent(elem, value.toString());
052:                    }
053:
054:                    public void unrenderTable(ElementTable table, int row,
055:                            int col, Element cellContentElem) {
056:                    }
057:                };
058:
059:                buildTable("tableId2", null, customRenderer);
060:
061:                ElementTableStructure customStructure = new ElementTableStructure() {
062:                    /*
063:                    <tbody id="tableId3">
064:                        <tr> <-- row
065:                            <td>
066:                                <table>
067:                                    <tbody>
068:                                        <tr> <-- row content
069:                                            <td> <-- cell
070:                                                <table>
071:                                                    <tbody>
072:                                                        <tr>
073:                                                            <td>Cell pattern</td> <-- td: cell content
074:                                                        </tr>
075:                                                    </tbody>
076:                                                </table>
077:                                            </td>
078:                                            ...
079:                                        </tr>
080:                                    </tbody>
081:                                </table>
082:                            </td>
083:                        </tr>
084:                    </tbody>
085:                     */
086:                    public Element getRowContentElement(ElementTable table,
087:                            int row, Element elem) {
088:                        HTMLTableRowElement rowElem = (HTMLTableRowElement) elem;
089:                        HTMLTableCellElement cellElem = (HTMLTableCellElement) ItsNatTreeWalker
090:                                .getFirstChildElement(rowElem);
091:                        HTMLTableElement tableElem = (HTMLTableElement) ItsNatTreeWalker
092:                                .getFirstChildElement(cellElem);
093:                        HTMLTableSectionElement tbodyElem = (HTMLTableSectionElement) ItsNatTreeWalker
094:                                .getFirstChildElement(tableElem);
095:                        HTMLTableRowElement rowElem2 = (HTMLTableRowElement) ItsNatTreeWalker
096:                                .getFirstChildElement(tbodyElem);
097:                        return rowElem2;
098:                    }
099:
100:                    public Element getCellContentElement(ElementTable table,
101:                            int row, int col, Element elem) {
102:                        HTMLTableCellElement cellElem = (HTMLTableCellElement) elem;
103:                        HTMLTableElement tableElem = (HTMLTableElement) ItsNatTreeWalker
104:                                .getFirstChildElement(cellElem);
105:                        HTMLTableSectionElement tbodyElem = (HTMLTableSectionElement) ItsNatTreeWalker
106:                                .getFirstChildElement(tableElem);
107:                        HTMLTableRowElement rowElem = (HTMLTableRowElement) ItsNatTreeWalker
108:                                .getFirstChildElement(tbodyElem);
109:                        HTMLTableCellElement cellElem2 = (HTMLTableCellElement) ItsNatTreeWalker
110:                                .getFirstChildElement(rowElem);
111:                        return cellElem2;
112:                    }
113:
114:                };
115:
116:                buildTable("tableId3", customStructure, customRenderer);
117:
118:                buildTable("tableId4", null, null);
119:            }
120:
121:            public void buildTable(String tableId,
122:                    ElementTableStructure customStructure,
123:                    ElementTableRenderer customRenderer) {
124:                ItsNatDocument itsNatDoc = getItsNatDocument();
125:                Document doc = itsNatDoc.getDocument();
126:
127:                Element parent = doc.getElementById(tableId);
128:                ElementTable elemTable = itsNatDoc.createElementTable(parent,
129:                        true, customStructure, customRenderer);
130:                elemTable.setColumnCount(3);
131:                elemTable.addRow(new String[] { "Madrid", "Plaza Mayor",
132:                        "Palacio Real" });
133:                elemTable.addRow(new String[] { "Sevilla", "Plaza de Espaņa",
134:                        "Giralda" });
135:                elemTable.addRow(new String[] { "Segovia",
136:                        "Plaza del Azoguejo", "Acueducto Romano" });
137:            }
138:
139:            public void endExamplePanel() {
140:            }
141:
142:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.