Source Code Cross Referenced for BaseObjectTab.java in  » Database-Client » squirrel-sql-2.6.5a » net » sourceforge » squirrel_sql » client » session » mainpanel » objecttree » tabs » 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.client.session.mainpanel.objecttree.tabs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.tabs;
002:
003:        /*
004:         * Copyright (C) 2001-2002 Colin Bell
005:         * colbell@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:        import net.sourceforge.squirrel_sql.fw.datasetviewer.DataSetException;
022:        import net.sourceforge.squirrel_sql.fw.id.IIdentifier;
023:        import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo;
024:        import net.sourceforge.squirrel_sql.fw.util.log.ILogger;
025:        import net.sourceforge.squirrel_sql.fw.util.log.LoggerController;
026:
027:        import net.sourceforge.squirrel_sql.client.IApplication;
028:        import net.sourceforge.squirrel_sql.client.session.ISession;
029:
030:        /**
031:         * Base class for tabs to the added to one of the object panels.
032:         *
033:         * @author <A HREF="mailto:colbell@users.sourceforge.net">Colin Bell</A>
034:         */
035:        public abstract class BaseObjectTab implements  IObjectTab {
036:            /** Logger for this class. */
037:            private static final ILogger s_log = LoggerController
038:                    .createLogger(BaseObjectTab.class);
039:
040:            /** Application API. */
041:            protected IApplication _app;
042:
043:            /** Current session. */
044:            //	private ISession _session;
045:            /** ID of the session for this window. */
046:            private IIdentifier _sessionId;
047:
048:            /** Defines the object that info is to be displayed for. */
049:            private IDatabaseObjectInfo _dbObjInfo;
050:
051:            /**
052:             * Set to <TT>true</TT> if the current <TT>IDatabaseObjectInfo</TT> object
053:             * has been displayed.
054:             */
055:            private boolean _hasBeenDisplayed;
056:
057:            /**
058:             * Set the current session.
059:             *
060:             * @param	session	Current session.
061:             *
062:             * @throws	IllegalArgumentException
063:             *			Thrown if a <TT>null</TT> ISession</TT> passed.
064:             */
065:            public void setSession(ISession session)
066:                    throws IllegalArgumentException {
067:                if (session == null) {
068:                    throw new IllegalArgumentException("Null ISession passed");
069:                }
070:                _app = session.getApplication();
071:                //		_session = session;
072:                _sessionId = session.getIdentifier();
073:            }
074:
075:            /**
076:             * Retrieve the current session.
077:             *
078:             * @return	Current session.
079:             */
080:            public final ISession getSession() {
081:                //		return _session;
082:                return _app.getSessionManager().getSession(_sessionId);
083:            }
084:
085:            /**
086:             * This tab has been selected. This will call <TT>refreshComponent()</TT>
087:             * only if it hasn't been called for the current MTT>IDatabaseObjectInfo</TT> object.
088:             *
089:             * @throws	IllegalStateException
090:             *			Thrown if a <TT>null</TT> <TT>ISession</TT> or
091:             *			<TT>IDatabaseObjectInfo</TT> object is stored here.
092:             */
093:            public synchronized void select() {
094:                if (!_hasBeenDisplayed) {
095:                    s_log.debug("Refreshing " + getTitle() + " table tab.");
096:                    try {
097:                        clear();
098:                        refreshComponent();
099:                    } catch (Throwable th) {
100:                        getSession().showErrorMessage(th);
101:                    }
102:                    _hasBeenDisplayed = true;
103:                }
104:            }
105:
106:            /**
107:             * Rebuild the tab. This usually means that some kind of configuration
108:             * data has changed (I.E. the output type has changed from text to table).
109:             */
110:            public void rebuild() {
111:                _hasBeenDisplayed = false;
112:            }
113:
114:            /**
115:             * Refresh the component displaying the <TT>IDatabaseObjectInfo</TT> object.
116:             */
117:            protected abstract void refreshComponent() throws DataSetException;
118:
119:            /**
120:             * Set the <TT>IDatabaseObjectInfo</TT> object that specifies the object that
121:             * is to have its information displayed.
122:             *
123:             * @param	value	<TT>IDatabaseObjectInfo</TT> object that specifies the currently
124:             *					selected object. This can be <TT>null</TT>.
125:             */
126:            public void setDatabaseObjectInfo(IDatabaseObjectInfo value) {
127:                _dbObjInfo = value;
128:                _hasBeenDisplayed = false;
129:            }
130:
131:            /**
132:             * Retrieve the current <TT>IDatabaseObjectInfo</TT> object.
133:             *
134:             * @return	Current <TT>IDatabaseObjectInfo</TT> object.
135:             */
136:            protected final IDatabaseObjectInfo getDatabaseObjectInfo() {
137:                return _dbObjInfo;
138:            }
139:        }
ww__w_._ja_v__a_2__s._c_o___m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.