Source Code Cross Referenced for PreviewDatabaseVisualPanel.java in  » IDE-Netbeans » etl.project » org » netbeans » modules » mashup » db » ui » wizard » 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 » IDE Netbeans » etl.project » org.netbeans.modules.mashup.db.ui.wizard 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         * The contents of this file are subject to the terms of either the GNU
007:         * General Public License Version 2 only ("GPL") or the Common
008:         * Development and Distribution License("CDDL") (collectively, the
009:         * "License"). You may not use this file except in compliance with the
010:         * License. You can obtain a copy of the License at
011:         * http://www.netbeans.org/cddl-gplv2.html
012:         * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013:         * specific language governing permissions and limitations under the
014:         * License.  When distributing the software, include this License Header
015:         * Notice in each file and include the License file at
016:         * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
017:         * particular file as subject to the "Classpath" exception as provided
018:         * by Sun in the GPL Version 2 section of the License file that
019:         * accompanied this code. If applicable, add the following below the
020:         * License Header, with the fields enclosed by brackets [] replaced by
021:         * your own identifying information:
022:         * "Portions Copyrighted [year] [name of copyright owner]"
023:         *
024:         * Contributor(s):
025:         *
026:         * The Original Software is NetBeans. The Initial Developer of the Original
027:         * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028:         * Microsystems, Inc. All Rights Reserved.
029:         *
030:         * If you wish your version of this file to be governed by only the CDDL
031:         * or only the GPL Version 2, indicate your decision by adding
032:         * "[Contributor] elects to include this software in this distribution
033:         * under the [CDDL or GPL Version 2] license." If you do not indicate a
034:         * single choice of license, a recipient has the option to distribute
035:         * your version of this file under either the CDDL, the GPL Version 2 or
036:         * to extend the choice of license to its licensees as provided above.
037:         * However, if you add GPL Version 2 code and therefore, elected the GPL
038:         * Version 2 license, then the option applies only if the new code is
039:         * made subject to such option by the copyright holder.
040:         */
041:        package org.netbeans.modules.mashup.db.ui.wizard;
042:
043:        import java.awt.BorderLayout;
044:        import java.util.MissingResourceException;
045:
046:        import javax.swing.JPanel;
047:
048:        import net.java.hulp.i18n.Logger;
049:        import org.netbeans.modules.etl.logger.Localizer;
050:        import org.netbeans.modules.etl.logger.LogUtil;
051:        import org.netbeans.modules.mashup.db.model.FlatfileDatabaseModel;
052:        import org.netbeans.modules.mashup.db.ui.FlatfileTreeTableView;
053:        import org.netbeans.modules.mashup.db.ui.model.FlatfileTreeTableModel;
054:
055:        /**
056:         * Descriptor for single panel to select tables and columns to be included in an Flatfile
057:         * Database definition instance.
058:         * 
059:         * @author Jonathan Giron
060:         * @author Ahimanikya Satapathy
061:         * @version $Revision$
062:         */
063:        public class PreviewDatabaseVisualPanel extends JPanel {
064:
065:            private static transient final Logger mLogger = LogUtil
066:                    .getLogger(PreviewDatabaseVisualPanel.class.getName());
067:
068:            private static transient final Localizer mLoc = Localizer.get();
069:            /* Container to hold configuration components */
070:            private JPanel contentPanel;
071:
072:            /* Model used to supply content to FlatfileTreeTableView instance */
073:            private FlatfileTreeTableModel mTreeModel;
074:
075:            /* Component which displays content to be configured. */
076:            private FlatfileTreeTableView mTreeView;
077:
078:            /**
079:             * Constructs a new instance of PreviewDatabaseVisualPanel with the given
080:             * PreviewDatabasePanel instance as its owner.
081:             * 
082:             * @param panelHost owner of this new instance
083:             */
084:            public PreviewDatabaseVisualPanel(PreviewDatabasePanel panelHost) {
085:                mTreeModel = new FlatfileTreeTableModel();
086:                mTreeView = new FlatfileTreeTableView();
087:
088:                setLayout(new BorderLayout());
089:                String nbBundle1 = mLoc
090:                        .t("PRSR001: Preview Flat File Database Definition");
091:                try {
092:                    setName(Localizer.parse(nbBundle1));
093:                } catch (MissingResourceException e) {
094:                    setName("*** Preview Flatfile Database ***");
095:                }
096:            }
097:
098:            /**
099:             * Constructs a new instance of PreviewDatabaseVisualPanel
100:             * 
101:             * @param panelHost owner of this new instance
102:             */
103:            public PreviewDatabaseVisualPanel() {
104:                mTreeModel = new FlatfileTreeTableModel();
105:                mTreeView = new FlatfileTreeTableView();
106:
107:                setLayout(new BorderLayout());
108:                String nbBundle2 = mLoc
109:                        .t("PRSR001: Preview Flat File Database Definition");
110:                try {
111:                    setName(Localizer.parse(nbBundle2));
112:                } catch (MissingResourceException e) {
113:                    setName("*** Preview Flatfile Database ***");
114:                }
115:            }
116:
117:            /**
118:             * Gets FlatfileDatabaseModel representing current contents of this visual component.
119:             * 
120:             * @return FlatfileDatabaseModel representing the contents of this visual component
121:             */
122:            public FlatfileDatabaseModel getModel() {
123:                if (mTreeModel != null) {
124:                    FlatfileDatabaseModel modFolder = mTreeModel.getModel();
125:                    return modFolder;
126:                }
127:                return null;
128:            }
129:
130:            /**
131:             * Indicates whether the controls in this panel all have sufficient valid data to
132:             * advance the wizard to the next panel.
133:             * 
134:             * @return true if data are valid, false otherwise
135:             */
136:            public boolean hasValidData() {
137:                return true;
138:            }
139:
140:            /**
141:             * Sets data model of this visual component to the contents of the given
142:             * FlatfileDatabaseModel.
143:             * 
144:             * @param newModel FlatfileDatabaseModel whose contents will be rendered by this
145:             *        component
146:             */
147:            public void setModel(FlatfileDatabaseModel newModel) {
148:                mTreeModel.configureModel(newModel);
149:                mTreeView.setModel(mTreeModel);
150:
151:                if (contentPanel == null) {
152:                    contentPanel = createContentPanel(newModel, mTreeView);
153:                    add(contentPanel, BorderLayout.CENTER);
154:                }
155:
156:                mTreeView.revalidate();
157:                mTreeView.repaint();
158:            }
159:
160:            private JPanel createContentPanel(FlatfileDatabaseModel folder,
161:                    FlatfileTreeTableView view) {
162:                JPanel outermost = new JPanel(new BorderLayout());
163:
164:                mTreeView.setModel(mTreeModel);
165:                mTreeView.setDividerLocation(190);
166:                outermost.add(mTreeView, BorderLayout.CENTER);
167:                outermost.setSize(300, 200);
168:                return outermost;
169:            }
170:        }
w__w_w__._j__a_v_a2_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.