diff options
author | nhauge | 2009-04-14 17:18:01 +0000 |
---|---|---|
committer | nhauge | 2009-04-14 17:18:01 +0000 |
commit | fce53bdeee6ba01179b341a17b501e7e77ad794a (patch) | |
tree | 08c27a49942f994094b3290e5031d1f27029f4d1 | |
parent | 4b76cc21a41bdb315d44c37ce7de5fe41836fd65 (diff) | |
download | webtools.dali-fce53bdeee6ba01179b341a17b501e7e77ad794a.tar.gz webtools.dali-fce53bdeee6ba01179b341a17b501e7e77ad794a.tar.xz webtools.dali-fce53bdeee6ba01179b341a17b501e7e77ad794a.zip |
270982 - Contribution from Danny - update schema combo after adding new connection within wizard.
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/gen/DatabaseGroup.java | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/gen/DatabaseGroup.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/gen/DatabaseGroup.java index d8ab22cf76..8a030c1bf6 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/gen/DatabaseGroup.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/wizards/gen/DatabaseGroup.java @@ -25,9 +25,9 @@ import org.eclipse.jpt.core.JpaProject; import org.eclipse.jpt.db.ConnectionAdapter; import org.eclipse.jpt.db.ConnectionListener; import org.eclipse.jpt.db.ConnectionProfile; +import org.eclipse.jpt.db.Database; import org.eclipse.jpt.db.JptDbPlugin; import org.eclipse.jpt.db.Schema; -import org.eclipse.jpt.db.SchemaContainer; import org.eclipse.jpt.db.ui.internal.DTPUiTools; import org.eclipse.jpt.ui.CommonImages; import org.eclipse.jpt.ui.JptUiPlugin; @@ -223,8 +223,14 @@ public class DatabaseGroup } private Iterator<String> getSchemata() { - SchemaContainer sc = jpaProject.getDefaultDbSchemaContainer(); - return (sc == null) ? EmptyIterator.<String>instance() : sc.sortedSchemaIdentifiers(); + ConnectionProfile profile = this.getSelectedConnectionProfile(); + if( profile == null ) + return EmptyIterator.<String>instance() ; + Database db = profile.getDatabase(); + if ( db == null) + return EmptyIterator.<String>instance() ; + Iterator<String> ret = db.sortedSchemaIdentifiers(); + return ret; } /** @@ -312,12 +318,15 @@ public class DatabaseGroup isConnected[0]=false; Thread t= new Thread(){ public void run() { - selectedConnectionProfile.connect(); + try{ + selectedConnectionProfile.connect(); + }catch(Exception e ){ + } isConnected[0]=true; } }; t.start(); - while( !isConnected[0]){ + while( !isConnected[0] ){ Thread.sleep(1000); monitor.worked(1); } |