Revision: 3802
Author: [email protected]
Date: Thu Jul 29 07:58:38 2010
Log: Fixed an NPE in the DBTreeModel where its DBTreeSPListener to look for
an ancestor database object and cannot find one.
http://code.google.com/p/power-architect/source/detail?r=3802
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java
Thu Jul 29 07:24:00 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/dbtree/DBTreeModel.java
Thu Jul 29 07:58:38 2010
@@ -337,10 +337,6 @@
private boolean isSPObjectRelevant(SPObject spObject) {
if (!SQLPowerUtils.getAncestorList(spObject).contains(root)
&& !spObject.equals(root)) {
return false;
- } else if (!showPlayPenDatabase && spObject instanceof
SQLDatabase) {
- return ((SQLDatabase) spObject).isPlayPenDatabase();
- } else if (!showPlayPenDatabase &&
SQLPowerUtils.getAncestor(spObject, SQLDatabase.class).isPlayPenDatabase())
{
- return false;
} else if (!showColumns && spObject instanceof SQLColumn) {
return false;
} else if (!showRelationships && spObject instanceof
SQLRelationship) {
@@ -349,6 +345,15 @@
return false;
} else if (!showIndices && spObject instanceof SQLIndex) {
return false;
+ } else if (!showPlayPenDatabase && spObject instanceof
SQLDatabase) {
+ return ((SQLDatabase) spObject).isPlayPenDatabase();
+ } else if (!showPlayPenDatabase) {
+ SQLDatabase db = SQLPowerUtils.getAncestor(spObject,
SQLDatabase.class);
+ if (db != null && db.isPlayPenDatabase()) {
+ return false;
+ } else {
+ return true;
+ }
} else {
return true;
}