Revision: 4040
Author: [email protected]
Date: Mon Dec 13 15:01:55 2010
Log: FIXED BUG 3110: No longer any exception when dragging wrong sections
of cubes into dimensions.
http://code.google.com/p/power-architect/source/detail?r=4040
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/DimensionPane.java
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/DimensionPane.java
Fri Jul 16 07:18:35 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/olap/DimensionPane.java
Mon Dec 13 15:01:55 2010
@@ -24,6 +24,8 @@
import java.util.ArrayList;
import java.util.List;
+import javax.swing.JOptionPane;
+
import org.apache.log4j.Logger;
import ca.sqlpower.architect.olap.OLAPObject;
@@ -255,7 +257,14 @@
// also OLAPObjects. If it is a Hierarchy, then we do not
want to
// move its levels as well because they come with the
Hierarchy
// anyways.
- items.add(((HierarchySection)
coord.getSection()).getHierarchy());
+ if(coord.getSection() instanceof HierarchySection) {
+ items.add(((HierarchySection)
coord.getSection()).getHierarchy());
+ } else {
+ JOptionPane.showMessageDialog(null,
+ coord.getSection() + " is not a Hierarchy
Section.",
+ "Error",
+ JOptionPane.ERROR_MESSAGE);
+ }
} else if (coord.getIndex() >= 0) {
if (coord.getItem() == null) {
throw new NullPointerException(