Source Code Cross Referenced for InformixPlugin.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » plugins » informix » 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 » squirrel sql 2.6.5a » net.sourceforge.squirrel_sql.plugins.informix 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sourceforge.squirrel_sql.plugins.informix;
002:
003:        /*
004:         * Copyright (C) 2006 Rob Manning
005:         * manningr@users.sourceforge.net
006:         *
007:         * This library is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU Lesser General Public
009:         * License as published by the Free Software Foundation; either
010:         * version 2.1 of the License, or (at your option) any later version.
011:         *
012:         * This library is distributed in the hope that it will be useful,
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
015:         * Lesser General Public License for more details.
016:         *
017:         * You should have received a copy of the GNU Lesser General Public
018:         * License along with this library; if not, write to the Free Software
019:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
020:         */
021:
022:        import net.sourceforge.squirrel_sql.client.IApplication;
023:        import net.sourceforge.squirrel_sql.client.gui.session.ObjectTreeInternalFrame;
024:        import net.sourceforge.squirrel_sql.client.gui.session.SQLInternalFrame;
025:        import net.sourceforge.squirrel_sql.client.plugin.DefaultSessionPlugin;
026:        import net.sourceforge.squirrel_sql.client.plugin.PluginException;
027:        import net.sourceforge.squirrel_sql.client.plugin.PluginSessionCallback;
028:        import net.sourceforge.squirrel_sql.client.session.IObjectTreeAPI;
029:        import net.sourceforge.squirrel_sql.client.session.ISession;
030:        import net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.TableWithChildNodesExpander;
031:        import net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs.DatabaseObjectInfoTab;
032:        import net.sourceforge.squirrel_sql.fw.dialects.DialectFactory;
033:        import net.sourceforge.squirrel_sql.fw.gui.GUIUtils;
034:        import net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectType;
035:        import net.sourceforge.squirrel_sql.fw.util.StringManager;
036:        import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
037:        import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
038:        import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
039:        import net.sourceforge.squirrel_sql.plugins.informix.exception.InformixExceptionFormatter;
040:        import net.sourceforge.squirrel_sql.plugins.informix.exp.InformixTableIndexExtractorImpl;
041:        import net.sourceforge.squirrel_sql.plugins.informix.exp.InformixTableTriggerExtractorImpl;
042:        import net.sourceforge.squirrel_sql.plugins.informix.exp.SchemaExpander;
043:        import net.sourceforge.squirrel_sql.plugins.informix.tab.IndexDetailsTab;
044:        import net.sourceforge.squirrel_sql.plugins.informix.tab.ProcedureSourceTab;
045:        import net.sourceforge.squirrel_sql.plugins.informix.tab.SequenceDetailsTab;
046:        import net.sourceforge.squirrel_sql.plugins.informix.tab.TriggerDetailsTab;
047:        import net.sourceforge.squirrel_sql.plugins.informix.tab.TriggerSourceTab;
048:        import net.sourceforge.squirrel_sql.plugins.informix.tab.ViewSourceTab;
049:
050:        /**
051:         * The main controller class for the Informix plugin.
052:         * 
053:         * @author manningr
054:         */
055:        public class InformixPlugin extends DefaultSessionPlugin {
056:
057:            private static final StringManager s_stringMgr = StringManagerFactory
058:                    .getStringManager(InformixPlugin.class);
059:
060:            /** Logger for this class. */
061:            @SuppressWarnings("unused")
062:            private final static ILogger s_log = LoggerController
063:                    .createLogger(InformixPlugin.class);
064:
065:            /** API for the Obejct Tree. */
066:            private IObjectTreeAPI _treeAPI;
067:
068:            static interface i18n {
069:                //i18n[InformixPlugin.showViewSource=Show view source]
070:                String SHOW_VIEW_SOURCE = s_stringMgr
071:                        .getString("InformixPlugin.showViewSource");
072:
073:                //i18n[InformixPlugin.showProcedureSource=Show procedure source]
074:                String SHOW_PROCEDURE_SOURCE = s_stringMgr
075:                        .getString("InformixPlugin.showProcedureSource");
076:            }
077:
078:            /**
079:             * Return the internal name of this plugin.
080:             *
081:             * @return  the internal name of this plugin.
082:             */
083:            public String getInternalName() {
084:                return "informix";
085:            }
086:
087:            /**
088:             * Return the descriptive name of this plugin.
089:             *
090:             * @return  the descriptive name of this plugin.
091:             */
092:            public String getDescriptiveName() {
093:                return "Informix Plugin";
094:            }
095:
096:            /**
097:             * Returns the current version of this plugin.
098:             *
099:             * @return  the current version of this plugin.
100:             */
101:            public String getVersion() {
102:                return "0.03";
103:            }
104:
105:            /**
106:             * Returns the authors name.
107:             *
108:             * @return  the authors name.
109:             */
110:            public String getAuthor() {
111:                return "Rob Manning";
112:            }
113:
114:            /**
115:             * Returns a comma separated list of other contributors.
116:             *
117:             * @return  Contributors names.
118:             */
119:            public String getContributors() {
120:                return "Doug Lawry";
121:            }
122:
123:            /**
124:             * @see net.sourceforge.squirrel_sql.client.plugin.IPlugin#getChangeLogFileName()
125:             */
126:            public String getChangeLogFileName() {
127:                return "changes.txt";
128:            }
129:
130:            /**
131:             * @see net.sourceforge.squirrel_sql.client.plugin.IPlugin#getHelpFileName()
132:             */
133:            public String getHelpFileName() {
134:                return "readme.html";
135:            }
136:
137:            /**
138:             * @see net.sourceforge.squirrel_sql.client.plugin.IPlugin#getLicenceFileName()
139:             */
140:            public String getLicenceFileName() {
141:                return "licence.txt";
142:            }
143:
144:            /**
145:             * Load this plugin.
146:             *
147:             * @param	app	 Application API.
148:             */
149:            public synchronized void load(IApplication app)
150:                    throws PluginException {
151:                super .load(app);
152:            }
153:
154:            /**
155:             * Initialize this plugin.
156:             */
157:            public synchronized void initialize() throws PluginException {
158:                super .initialize();
159:            }
160:
161:            /**
162:             * Application is shutting down so save preferences.
163:             */
164:            public void unload() {
165:                super .unload();
166:            }
167:
168:            public boolean allowsSessionStartedInBackground() {
169:                return true;
170:            }
171:
172:            /**
173:             * Session has been started. Update the tree api in using the event thread
174:             *
175:             * @param   session     Session that has started.
176:             *
177:             * @return  <TT>true</TT> if session is Oracle in which case this plugin
178:             *                          is interested in it.
179:             */
180:            public PluginSessionCallback sessionStarted(final ISession session) {
181:                if (!isPluginSession(session)) {
182:                    return null;
183:                }
184:                GUIUtils.processOnSwingEventThread(new Runnable() {
185:                    public void run() {
186:                        updateTreeApi(session);
187:                    }
188:                });
189:                InformixExceptionFormatter formatter = new InformixExceptionFormatter(
190:                        session);
191:                session.setExceptionFormatter(formatter);
192:                return new PluginSessionCallback() {
193:                    public void sqlInternalFrameOpened(
194:                            SQLInternalFrame sqlInternalFrame, ISession sess) {
195:                        // Supports Session main window only
196:                    }
197:
198:                    public void objectTreeInternalFrameOpened(
199:                            ObjectTreeInternalFrame objectTreeInternalFrame,
200:                            ISession sess) {
201:                        // Supports Session main window only
202:                    }
203:                };
204:            }
205:
206:            @Override
207:            protected boolean isPluginSession(ISession session) {
208:                return DialectFactory.isInformix(session.getMetaData());
209:            }
210:
211:            private void updateTreeApi(ISession session) {
212:                //DatabaseObjectInfoTab dboit = new DatabaseObjectInfoTab();
213:
214:                _treeAPI = session.getSessionInternalFrame().getObjectTreeAPI();
215:
216:                _treeAPI.addDetailTab(DatabaseObjectType.PROCEDURE,
217:                        new ProcedureSourceTab(i18n.SHOW_PROCEDURE_SOURCE));
218:
219:                _treeAPI.addDetailTab(DatabaseObjectType.VIEW,
220:                        new ViewSourceTab(i18n.SHOW_VIEW_SOURCE));
221:
222:                _treeAPI.addDetailTab(DatabaseObjectType.INDEX,
223:                        new DatabaseObjectInfoTab());
224:                _treeAPI.addDetailTab(DatabaseObjectType.INDEX,
225:                        new IndexDetailsTab());
226:                _treeAPI.addDetailTab(DatabaseObjectType.TRIGGER,
227:                        new DatabaseObjectInfoTab());
228:                _treeAPI.addDetailTab(DatabaseObjectType.TRIGGER_TYPE_DBO,
229:                        new DatabaseObjectInfoTab());
230:                _treeAPI.addDetailTab(DatabaseObjectType.SEQUENCE,
231:                        new DatabaseObjectInfoTab());
232:                _treeAPI.addDetailTab(DatabaseObjectType.SEQUENCE,
233:                        new SequenceDetailsTab());
234:
235:                // Expanders - trigger and index expanders are added inside the table
236:                // expander
237:                _treeAPI.addExpander(DatabaseObjectType.SCHEMA,
238:                        new SchemaExpander());
239:
240:                TableWithChildNodesExpander tableExp = new TableWithChildNodesExpander();
241:                tableExp
242:                        .setTableIndexExtractor(new InformixTableIndexExtractorImpl());
243:                tableExp
244:                        .setTableTriggerExtractor(new InformixTableTriggerExtractorImpl());
245:                _treeAPI.addExpander(DatabaseObjectType.TABLE, tableExp);
246:
247:                _treeAPI.addDetailTab(DatabaseObjectType.TRIGGER,
248:                        new TriggerDetailsTab());
249:                _treeAPI.addDetailTab(DatabaseObjectType.TRIGGER,
250:                        new TriggerSourceTab("The source of the trigger"));
251:
252:            }
253:
254:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.