Source Code Cross Referenced for ImRPOATableModel.java in  » Collaboration » JacORB » org » jacorb » imr » util » 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 » Collaboration » JacORB » org.jacorb.imr.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *        JacORB - a free Java ORB
003:         *
004:         *   Copyright (C) 1999-2004 Gerald Brose
005:         *
006:         *   This library is free software; you can redistribute it and/or
007:         *   modify it under the terms of the GNU Library General Public
008:         *   License as published by the Free Software Foundation; either
009:         *   version 2 of the License, or (at your option) any later version.
010:         *
011:         *   This library is distributed in the hope that it will be useful,
012:         *   but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:         *   Library General Public License for more details.
015:         *
016:         *   You should have received a copy of the GNU Library General Public
017:         *   License along with this library; if not, write to the Free
018:         *   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
019:         *
020:         */
021:        package org.jacorb.imr.util;
022:
023:        import javax.swing.table.*;
024:        import org.jacorb.imr.*;
025:        import javax.swing.event.*;
026:
027:        /**
028:         * This is the model for the POA table. It does
029:         * not write back data since the entries in the POA
030:         * table are not editable.
031:         *
032:         * @author Nicolas Noffke
033:         *
034:         * $Log: ImRPOATableModel.java,v $
035:         * Revision 1.8  2006/06/16 12:36:28  alphonse.bendt
036:         * fixed some findbugs warnings
037:         *
038:         * Revision 1.7  2004/05/06 12:39:59  nicolas
039:         * Updated Copyright notice to 2004
040:         *
041:         * Revision 1.6  2002/12/20 18:29:04  nicolas
042:         * Updated Copyright year to 2003
043:         *
044:         * Revision 1.5  2002/07/01 07:54:16  nicolas
045:         * updated or inserted Copyright notice
046:         *
047:         * Revision 1.4  2002/03/19 09:25:11  nicolas
048:         * updated copyright to 2002
049:         *
050:         * Revision 1.3  2002/03/19 11:08:01  brose
051:         * *** empty log message ***
052:         *
053:         * Revision 1.2  2002/03/17 18:44:01  brose
054:         * *** empty log message ***
055:         *
056:         * Revision 1.4  1999/11/25 16:05:48  brose
057:         * cosmetics
058:         *
059:         * Revision 1.3  1999/11/21 20:15:52  noffke
060:         * GUI data is now updated periodically by a thread
061:         *
062:         * Revision 1.2  1999/11/14 17:15:40  noffke
063:         * Cosmetics and commenting
064:         *
065:         *
066:         */
067:
068:        public class ImRPOATableModel extends AbstractTableModel {
069:            private static final String[] m_columns = new String[] { "Name",
070:                    "Host", "Port", "active" };
071:
072:            private POAInfo[] m_poas = null;
073:
074:            /**
075:             * Pass in the POAs the POA table should display.
076:             * Notify the JTable of this event.
077:             *
078:             * @param poas an array containing the POAs to display.
079:             */
080:            public void setPOAs(POAInfo[] poas) {
081:                if (m_poas != poas) {
082:                    m_poas = poas;
083:                    fireTableChanged(new TableModelEvent(this ));
084:                }
085:            }
086:
087:            /**
088:             * Get the number of rows.
089:             *
090:             * @return int the number of rows of this table.
091:             */
092:            public int getRowCount() {
093:                if (m_poas == null)
094:                    return 0;
095:                else
096:                    return m_poas.length;
097:            }
098:
099:            /**
100:             * Get the number of columns.
101:             *
102:             * @return int the number of columns of this table.
103:             */
104:            public int getColumnCount() {
105:                return m_columns.length;
106:            }
107:
108:            /**
109:             * Get the name of a specific column.
110:             *
111:             * @param column the columns number.
112:             * @return the columns name.
113:             */
114:            public String getColumnName(int column) {
115:                return m_columns[column];
116:            }
117:
118:            /**
119:             * Get the class of a specific column.
120:             *
121:             * @param index the columns index.
122:             * @return the Class object for the column.
123:             */
124:            public Class getColumnClass(int index) {
125:                if (index == 0 || index == 1)
126:                    return String.class;
127:
128:                else if (index == 2)
129:                    return Integer.class;
130:
131:                else if (index == 3)
132:                    return Boolean.class;
133:
134:                else
135:                    return Object.class;
136:            }
137:
138:            /**
139:             * Get the value of a specific table cell.
140:             *
141:             * @param row the cells row.
142:             * @param column the cells column.
143:             * @return Object the cells value.
144:             */
145:            public Object getValueAt(int row, int column) {
146:                if (column == 0)
147:                    return m_poas[row].name;
148:
149:                else if (column == 1)
150:                    return m_poas[row].host;
151:
152:                else if (column == 2)
153:                    return new Integer(m_poas[row].port);
154:
155:                else if (column == 3)
156:                    return Boolean.valueOf(m_poas[row].active);
157:
158:                return new Object();
159:            }
160:
161:            /**
162:             * Get the name of the server these POAs are associated with.
163:             *
164:             * @return a server name.
165:             */
166:            public String getServerName() {
167:                if (m_poas == null || m_poas.length == 0)
168:                    return null;
169:                else
170:                    //all POAs in one array have the same server
171:                    return m_poas[0].server;
172:            }
173:        } // ImRPOATableModel
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.