Source Code Cross Referenced for TableBrowserContract.java in  » XML-UI » SwingML » org » swingml » treetablebrowser » ext » 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 » XML UI » SwingML » org.swingml.treetablebrowser.ext 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.swingml.treetablebrowser.ext;
002:
003:        import java.util.*;
004:
005:        /**
006:         * @author dpitt
007:         *
008:         * To change this generated comment edit the template variable "typecomment":
009:         * Window>Preferences>Java>Templates.
010:         * To enable and disable the creation of type comments go to
011:         * Window>Preferences>Java>Code Generation.
012:         */
013:        public class TableBrowserContract implements  BrowserContract {
014:            private ArrayList columnSortOrder = new ArrayList();
015:            BitSet columnSortType = new BitSet(3);
016:            private List headings = new ArrayList();
017:            //default sorted column
018:            int sortedColumn = 1;
019:            private Object[][] values = null;
020:
021:            public TableBrowserContract(Object[][] d) {
022:                values = d;
023:                //set the default sorted column to asscending for the last 
024:                //columnSortType.set(1);
025:            }
026:
027:            public int compareValues(Object a, Object b, int column) {
028:                int returnValue = 0;
029:                switch (column) {
030:                case 0:
031:                case 1:
032:                case 2:
033:                }
034:                return returnValue;
035:            }
036:
037:            /**
038:             * @see com.yellow.common.gui.components.BrowserContract#editValue(String, int, String)
039:             */
040:            public String editValue(String column, int row, String value) {
041:                return null;
042:            }
043:
044:            /**
045:             * @see com.yellow.common.gui.components.BrowserContract#filter(String, String)
046:             */
047:            public void filter(String colname, String value) {
048:            }
049:
050:            /**
051:             * Returns the columnSortOrder.
052:             * @return ArrayList
053:             */
054:            public ArrayList getColumnSortOrder() {
055:                return columnSortOrder;
056:            }
057:
058:            public boolean getColumnSortType() {
059:                return columnSortType.get(sortedColumn);
060:            }
061:
062:            public boolean getColumnSortType(int col) {
063:                return columnSortType.get(col);
064:            }
065:
066:            /**
067:             * @see com.yellow.common.gui.components.BrowserContract#getHeadings()
068:             */
069:            public String[] getHeadings() {
070:                String[] result = new String[headings.size()];
071:                for (int i = 0; i < headings.size(); i++) {
072:                    result[i] = (String) headings.get(i);
073:                }
074:                return result;
075:            }
076:
077:            public int getSortedColumn() {
078:                return sortedColumn;
079:            }
080:
081:            /**
082:             * @see com.yellow.common.gui.components.BrowserContract#getValue(int, int)
083:             */
084:            public String getValue(int row, int col) {
085:                return (String) values[row][col];
086:            }
087:
088:            /**
089:             * Returns the values.
090:             * @return Object[][]
091:             */
092:            public Object[][] getValues() {
093:                return values;
094:            }
095:
096:            /**
097:             * @see com.yellow.common.gui.components.BrowserContract#hasMore(int)
098:             */
099:            public boolean hasMore(int row) {
100:                if (values == null) {
101:                    return false;
102:                }
103:                return row < values.length;
104:            }
105:
106:            public boolean hasSameSortTypeAsPrevious(int theSortedColumn,
107:                    int theSecondSortedColumn) {
108:                return (getColumnSortType(theSortedColumn) == getColumnSortType(theSecondSortedColumn));
109:            }
110:
111:            public boolean isEditable(int row) {
112:                return false;
113:            }
114:
115:            /**
116:             * @see com.yellow.common.gui.components.BrowserContract#isEditable(String)
117:             */
118:            public boolean isEditable(String heading) {
119:                return false;
120:            }
121:
122:            //we do have to worry about case 0 here because we can sort on the leaf names and the sort order is entirely maintained in the contract
123:            public Integer matchColumn(int column) {
124:                return new Integer(column);
125:                /*	switch (column) {
126:                		case 0 :
127:                			return new Integer(PREFIX);
128:                		case 1 :
129:                			return new Integer(NUMBER);
130:                		case 2 :
131:                			return new Integer(STATUS);
132:                		case 3 :
133:                			return new Integer(LENGTH);
134:                	
135:                
136:                	}   */
137:                //	return null;
138:            }
139:
140:            public void removeColumnFromSortOrder(int column) {
141:                columnSortOrder.remove(matchColumn(column));
142:            }
143:
144:            /**
145:             * Sets the columnSortOrder.
146:             * @param columnSortOrder The columnSortOrder to set
147:             */
148:            public void setColumnSortOrder(ArrayList columnSortOrder) {
149:                this .columnSortOrder = columnSortOrder;
150:            }
151:
152:            public void setColumnToPrimarySearch(int column) {
153:                Integer columnConstant = matchColumn(column);
154:                if (columnSortOrder.contains(columnConstant)) {
155:                    columnSortOrder.remove(columnConstant);
156:                }
157:                columnSortOrder.add(columnConstant);
158:            }
159:
160:            /**
161:             * Sets the headings.
162:             * @param headings The headings to set
163:             */
164:            public void setHeadings(List headings) {
165:                this .headings = headings;
166:            }
167:
168:            public void setSortedColumn(int theNewSortedColumn) {
169:                sortedColumn = theNewSortedColumn;
170:            }
171:
172:            /**
173:             * Sets the values.
174:             * @param values The values to set
175:             */
176:            public void setValues(Object[][] values) {
177:                this .values = values;
178:            }
179:
180:            public void switchColumnSortType(int column) {
181:                if (columnSortType.get(column)) {
182:                    columnSortType.clear(column);
183:                } else {
184:                    columnSortType.set(column);
185:                }
186:            }
187:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.