Source Code Cross Referenced for ItsNatTableHeaderImpl.java in  » Ajax » ItsNat » org » itsnat » impl » comp » 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.impl.comp 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:          ItsNat Java Web Application Framework
003:          Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
004:          Author: Jose Maria Arranz Santamaria
005:
006:          This program is free software: you can redistribute it and/or modify
007:          it under the terms of the GNU Affero General Public License as published by
008:          the Free Software Foundation, either version 3 of the License, or
009:          (at your option) any later version. See the GNU Affero General Public 
010:          License for more details. See the copy of the GNU Affero General Public License
011:          included in this program. If not, see <http://www.gnu.org/licenses/>.
012:         */
013:
014:        package org.itsnat.impl.comp;
015:
016:        import javax.swing.DefaultListSelectionModel;
017:        import javax.swing.ListSelectionModel;
018:        import org.itsnat.comp.ItsNatTable;
019:        import org.itsnat.comp.ItsNatTableHeader;
020:        import org.itsnat.comp.ItsNatTableHeaderCellRenderer;
021:        import org.itsnat.comp.ui.ItsNatTableHeaderCellUI;
022:        import org.itsnat.comp.ui.ItsNatTableHeaderUI;
023:        import org.itsnat.core.ItsNatException;
024:        import org.itsnat.core.event.ParamTransport;
025:        import org.w3c.dom.Element;
026:        import org.w3c.dom.Node;
027:        import org.w3c.dom.events.Event;
028:        import org.w3c.dom.events.MouseEvent;
029:
030:        /**
031:         *
032:         * @author jmarranz
033:         */
034:        public abstract class ItsNatTableHeaderImpl extends
035:                ItsNatElementComponentImpl implements  ItsNatTableHeader {
036:            protected ItsNatTableHeaderCellRenderer renderer;
037:            protected ItsNatTableImpl tableComp;
038:            protected ListSelectionModelMgrImpl selModelMgr;
039:
040:            /**
041:             * Creates a new instance of ItsNatTableHeaderImpl
042:             */
043:            public ItsNatTableHeaderImpl(ItsNatTableImpl tableComp,
044:                    Element headerElem) {
045:                // El element puede ser nulo (no hay header)
046:                super (headerElem, null, tableComp
047:                        .getItsNatComponentManagerImpl());
048:
049:                this .tableComp = tableComp;
050:
051:                ItsNatComponentManagerImpl componentMgr = getItsNatComponentManagerImpl();
052:
053:                setItsNatTableHeaderCellRenderer(componentMgr
054:                        .createDefaultItsNatTableHeaderCellRenderer());
055:            }
056:
057:            public void setDefaultListSelectionModel() {
058:                ListSelectionModel selModel = new DefaultListSelectionModel();
059:                selModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
060:                setListSelectionModel(selModel);
061:            }
062:
063:            public Class getStructureClass() {
064:                // La estructura se debe obtener a través de ItsNatTable
065:                return null;
066:            }
067:
068:            public Object createDefaultStructure() {
069:                return null;
070:            }
071:
072:            public void enableEventListeners() {
073:                // Por ahora nada porque los eventos (click de selección de la columna) 
074:                // pues en el header se procesan en la clase Table asociada
075:            }
076:
077:            public ItsNatTable getItsNatTable() {
078:                return (ItsNatTable) tableComp;
079:            }
080:
081:            public ItsNatTableHeaderUI getItsNatTableHeaderUI() {
082:                return (ItsNatTableHeaderUI) compUI;
083:            }
084:
085:            public ItsNatTableHeaderCellRenderer getItsNatTableHeaderCellRenderer() {
086:                return renderer;
087:            }
088:
089:            public void setItsNatTableHeaderCellRenderer(
090:                    ItsNatTableHeaderCellRenderer renderer) {
091:                this .renderer = renderer;
092:            }
093:
094:            public void bindDataModel() {
095:                throw new ItsNatException("INTERNAL ERROR");
096:            }
097:
098:            public void unbindDataModel() {
099:                throw new ItsNatException("INTERNAL ERROR");
100:            }
101:
102:            public void syncUIWithDataModel() {
103:                throw new ItsNatException("INTERNAL ERROR");
104:            }
105:
106:            public Object createDefaultModelInternal() {
107:                return null;
108:            }
109:
110:            protected ParamTransport[] getParamTransports(String type) {
111:                return null;
112:            }
113:
114:            public ListSelectionModel getListSelectionModel() {
115:                if (selModelMgr == null)
116:                    return null;
117:                return selModelMgr.getListSelectionModel();
118:            }
119:
120:            public void unsetListSelectionModel() {
121:                if (selModelMgr != null)
122:                    selModelMgr.dispose();
123:                // No anulamos el selModelMgr para que se pueda recuperar el ListSelectionModel después de un dispose
124:            }
125:
126:            public void setListSelectionModel(ListSelectionModel selectionModel) {
127:                unsetListSelectionModel();
128:
129:                int size = getItsNatTable().getTableModel().getColumnCount();
130:                this .selModelMgr = ListSelectionModelMgrImpl
131:                        .newListSelectionModelMgr(selectionModel, size);
132:            }
133:
134:            public int getSelectedIndex() {
135:                return getListSelectionModel().getMinSelectionIndex();
136:            }
137:
138:            public void setSelectedIndex(int index) {
139:                getListSelectionModel().setSelectionInterval(index, index);
140:            }
141:
142:            public ItsNatTableHeaderCellUI processEvent(Node nodeClicked,
143:                    boolean toggle, boolean extend) {
144:                // Es llamado desde ItsNatTableImpl
145:                // Vemos si ha sido pulsada la cabecera
146:
147:                ItsNatTableHeaderUI headerUI = getItsNatTableHeaderUI();
148:                ItsNatTableHeaderCellUI colCellInfo = headerUI
149:                        .getItsNatTableHeaderCellUIFromNode(nodeClicked);
150:                if (colCellInfo == null)
151:                    return null;
152:
153:                int column = colCellInfo.getIndex();
154:                changeColumnSelection(column, toggle, extend);
155:
156:                return colCellInfo;
157:            }
158:
159:            public void changeColumnSelection(int columnIndex, boolean toggle,
160:                    boolean extend) {
161:                ListSelectionModel csm = getListSelectionModel();
162:
163:                boolean selected = csm.isSelectedIndex(columnIndex);
164:
165:                selModelMgr.changeSelectionModel(columnIndex, toggle, extend,
166:                        selected);
167:            }
168:
169:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.