Source Code Cross Referenced for IndexesTablePanel.java in  » Database-Client » JSqlTool » org » jsqltool » gui » tableplugins » 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 » Database Client » JSqlTool » org.jsqltool.gui.tableplugins 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.jsqltool.gui.tableplugins;
002:
003:        import javax.swing.*;
004:        import java.awt.*;
005:        import javax.swing.event.*;
006:        import javax.swing.table.*;
007:        import java.awt.event.*;
008:        import org.jsqltool.conn.DbConnectionUtil;
009:        import org.jsqltool.conn.DbConnection;
010:        import org.jsqltool.model.CustomTableModel;
011:        import java.sql.*;
012:        import java.util.*;
013:        import org.jsqltool.gui.*;
014:        import org.jsqltool.gui.tablepanel.*;
015:        import org.jsqltool.*;
016:        import org.jsqltool.gui.tableplugins.indexes.*;
017:        import org.jsqltool.gui.panel.*;
018:        import org.jsqltool.model.CustomTableModel;
019:        import org.jsqltool.utils.Options;
020:
021:        /**
022:         * <p>Title: JSqlTool Project</p>
023:         * <p>Description: This panel contains indexes properties.
024:         * </p>
025:         * <p>Copyright: Copyright (C) 2006 Mauro Carniel</p>
026:         *
027:         * <p> This file is part of JSqlTool project.
028:         * This library is free software; you can redistribute it and/or
029:         * modify it under the terms of the (LGPL) Lesser General Public
030:         * License as published by the Free Software Foundation;
031:         *
032:         *                GNU LESSER GENERAL PUBLIC LICENSE
033:         *                 Version 2.1, February 1999
034:         *
035:         * This library is distributed in the hope that it will be useful,
036:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
037:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
038:         * Library General Public License for more details.
039:         *
040:         * You should have received a copy of the GNU Library General Public
041:         * License along with this library; if not, write to the Free
042:         * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
043:         *
044:         *       The author may be contacted at:
045:         *           maurocarniel@tin.it</p>
046:         *
047:         * @author Mauro Carniel
048:         * @version 1.0
049:         */
050:        public class IndexesTablePanel extends TablePluginAdapter {
051:
052:            private Hashtable pk = null;
053:            JPanel buttonsPanel = new JPanel();
054:            JButton enableAllButton = new JButton();
055:            JButton disableAllButton = new JButton();
056:            JButton enableButton = new JButton();
057:            JButton disableButton = new JButton();
058:            JButton dropButton = new JButton();
059:            ImageIcon enableAllImage;
060:            ImageIcon disableAllImage;
061:            ImageIcon enableImage;
062:            ImageIcon disableImage;
063:            ImageIcon dropImage;
064:            FlowLayout flowLayout1 = new FlowLayout();
065:            BorderLayout borderLayout1 = new BorderLayout();
066:            private JFrame parent = null;
067:            GridBagLayout gridBagLayout1 = new GridBagLayout();
068:
069:            /** class related to the dabase type currently in use */
070:            private Indexes indexes = null;
071:
072:            public IndexesTablePanel() {
073:                /*
074:                 try {
075:                 jbInit();
076:                 }
077:                 catch(Exception e) {
078:                 e.printStackTrace();
079:                 }
080:                 */
081:            }
082:
083:            /**
084:             * @return panel position inside the JTabbedPane related to the table detail
085:             */
086:            public int getTabbedPosition() {
087:                return 3;
088:            }
089:
090:            /**
091:             * @return folder name of the plugin panel, inside the JTabbedPane related to the table detail
092:             */
093:            public String getTabbedName() {
094:                return Options.getInstance().getResource("indexes");
095:            }
096:
097:            /**
098:             * This method is called from the table detail before the inizialization of the plugin panel
099:             */
100:            public void init(DbConnectionUtil dbConnUtil) {
101:                if (dbConnUtil.getDbConnection().getDbType() == DbConnection.ORACLE_TYPE)
102:                    indexes = new OracleIndexes(dbConnUtil);
103:                else
104:                    indexes = new VoidIndexes(dbConnUtil);
105:            }
106:
107:            public String getQuery(String tableName, DbConnectionUtil dbConnUtil) {
108:                return indexes.getQueryIndexes(tableName);
109:            }
110:
111:            /**
112:             * @return infos about the author of the plugin panel; "" or null does not report any info about the plugin panel
113:             */
114:            public String getAuthor() {
115:                return "";
116:            }
117:
118:            /**
119:             * @return plugin panel version
120:             */
121:            public String getVersion() {
122:                return "1.0";
123:            }
124:
125:            /**
126:             * @return plugin panel name, reported into the about window
127:             */
128:            public String getName() {
129:                return Options.getInstance()
130:                        .getResource("table indexes plugin");
131:            }
132:
133:            public void setQuery(String tableName) {
134:                if (indexes.getQueryIndexes(tableName) != null) {
135:                    super .setQuery(tableName);
136:                    return;
137:                }
138:                this .tableName = tableName;
139:                try {
140:                    ResultSet rset = this .getDbConnUtil().getConn()
141:                            .getMetaData().getIndexInfo(null, null, tableName,
142:                                    false, true);
143:                    int num = rset.getMetaData().getColumnCount();
144:                    String[] colNames = new String[num];
145:                    Class[] classNames = new Class[num];
146:                    int[] typeNames = new int[num];
147:                    for (int i = 0; i < num; i++) {
148:                        try {
149:                            colNames[i] = rset.getMetaData().getColumnName(
150:                                    i + 1);
151:                            classNames[i] = Class.forName(rset.getMetaData()
152:                                    .getColumnClassName(i + 1));
153:                            typeNames[i] = rset.getMetaData().getColumnType(
154:                                    i + 1);
155:                        } catch (Exception ex) {
156:                        } catch (Error er) {
157:                        }
158:                    }
159:                    CustomTableModel model = new CustomTableModel(colNames,
160:                            classNames, typeNames);
161:                    Object[] row = null;
162:                    while (rset.next()) {
163:                        row = new Object[num];
164:                        for (int i = 0; i < num; i++)
165:                            row[i] = rset.getObject(i + 1);
166:                        model.addRow(row);
167:                    }
168:                    rset.close();
169:                    this .getDataPanel().getTable().setModel(model);
170:                    ((CustomTableModel) this .getDataPanel().getTableModel())
171:                            .setEditMode(CustomTableModel.DETAIL_REC);
172:                } catch (Exception ex) {
173:                    ex.printStackTrace();
174:                }
175:            }
176:
177:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.