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-2006 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:
042: package org.netbeans.modules.dbschema.jdbcimpl.wizard;
043:
044: import java.beans.*;
045: import java.util.LinkedList;
046: import java.util.Vector;
047: import org.netbeans.api.db.explorer.DatabaseConnection;
048:
049: import org.openide.loaders.DataFolder;
050:
051: import org.netbeans.modules.dbschema.jdbcimpl.ConnectionProvider;
052:
053: public class DBSchemaWizardData {
054:
055: private DataFolder destinationPackage;
056: private String name;
057: private String driver;
058: private DatabaseConnection dbconn;
059: private boolean existingConn;
060: private ConnectionProvider cp;
061: private LinkedList tables;
062: private LinkedList views;
063: private boolean connected;
064: private String schema;
065: private Vector schemas;
066: private boolean all;
067:
068: private PropertyChangeSupport propertySupport;
069:
070: /** Creates new DBSchemaWizardData */
071: public DBSchemaWizardData() {
072: schemas = new Vector();
073: propertySupport = new PropertyChangeSupport(this );
074: }
075:
076: public void setName(String name) {
077: this .name = name;
078: }
079:
080: public String getName() {
081: return name;
082: }
083:
084: public void setDestinationPackage(DataFolder destinationPackage) {
085: this .destinationPackage = destinationPackage;
086: }
087:
088: public DataFolder getDestinationPackage() {
089: return destinationPackage;
090: }
091:
092: public void setDriver(String driver) {
093: this .driver = driver;
094: }
095:
096: public String getDriver() {
097: return driver;
098: }
099:
100: public void setDatabaseConnection(DatabaseConnection dbconn) {
101: this .dbconn = dbconn;
102: }
103:
104: public DatabaseConnection getDatabaseConnection() {
105: return dbconn;
106: }
107:
108: public void setExistingConn(boolean existingConn) {
109: this .existingConn = existingConn;
110: }
111:
112: public boolean isExistingConn() {
113: return existingConn;
114: }
115:
116: public void setConnectionProvider(ConnectionProvider cp) {
117: this .cp = cp;
118: }
119:
120: public ConnectionProvider getConnectionProvider() {
121: return cp;
122: }
123:
124: public void setTables(LinkedList tables) {
125: this .tables = tables;
126: }
127:
128: public LinkedList getTables() {
129: return tables;
130: }
131:
132: public void setViews(LinkedList views) {
133: this .views = views;
134: }
135:
136: public LinkedList getViews() {
137: return views;
138: }
139:
140: public void setConnected(boolean connected) {
141: this .connected = connected;
142: }
143:
144: public boolean isConnected() {
145: return connected;
146: }
147:
148: public void setSchemas(Vector schemas) {
149: this .schemas = schemas;
150: }
151:
152: public Vector getSchemas() {
153: return schemas;
154: }
155:
156: public void setSchema(String schema) {
157: this .schema = schema;
158: }
159:
160: public String getSchema() {
161: return schema;
162: }
163:
164: public void setAllTables(boolean all) {
165: this .all = all;
166: }
167:
168: public boolean isAllTables() {
169: return all;
170: }
171:
172: //==== property change support needed for schemas ====
173: public PropertyChangeSupport getPropertySupport() {
174: return propertySupport;
175: }
176:
177: public void addPropertyChangeListener(PropertyChangeListener l) {
178: propertySupport.addPropertyChangeListener(l);
179: }
180:
181: public void removePropertyChangeListener(PropertyChangeListener l) {
182: propertySupport.removePropertyChangeListener(l);
183: }
184: }
|