Revision: 3998
Author: [email protected]
Date: Thu Nov 25 15:22:26 2010
Log: Fix for bug 3088: a database that is not currently in the tree can be
added even if, behind the scenes, it is currently the "target database".
http://code.google.com/p/power-architect/source/detail?r=3998
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/DBTree.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/DBTree.java Thu Nov
4 09:35:52 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/swingui/DBTree.java Thu Nov
25 15:22:26 2010
@@ -722,8 +722,8 @@
public void addSourceConnection(SPDataSource dbcs) {
SQLObject root = (SQLObject) getModel().getRoot();
try {
- // check to see if we've already seen this one
- if (dbcsAlreadyExists(dbcs)) {
+ // check to see if we've already seen this one (and it's not the
playpen database)
+ if (dbcsAlreadyExists(dbcs)
&& !dbcs.equals(session.getTargetDatabase().getDataSource())) {
logger.warn("database already exists in this project.");
//$NON-NLS-1$
JOptionPane.showMessageDialog(DBTree.this,
Messages.getString("DBTree.connectionAlreadyExists",
dbcs.getDisplayName()), //$NON-NLS-1$
Messages.getString("DBTree.connectionAlreadyExistsDialogTitle"),
JOptionPane.WARNING_MESSAGE); //$NON-NLS-1$