Author: jfuerth
Date: Tue Sep 30 08:09:55 2008
New Revision: 2731
Modified:
trunk/src/ca/sqlpower/architect/swingui/olap/OLAPEditSession.java
Log:
Fixed bug that was causing NPE when loading projects that contain OLAP Edit
Sessions. The cause of the problem was that the OLAP editor was trying to
talk to the ArchitectFrame before the latter had been created.
Modified: trunk/src/ca/sqlpower/architect/swingui/olap/OLAPEditSession.java
==============================================================================
--- trunk/src/ca/sqlpower/architect/swingui/olap/OLAPEditSession.java
(original)
+++ trunk/src/ca/sqlpower/architect/swingui/olap/OLAPEditSession.java Tue
Sep 30 08:09:55 2008
@@ -25,7 +25,6 @@
import javax.swing.AbstractAction;
import javax.swing.JFrame;
-import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
@@ -93,11 +92,6 @@
*/
private final OLAPUndoManager undoManager;
- /**
- * The menu bar for this OLAP edit session's frame.
- */
- private final JMenuBar newMenuBar;
-
public static final double ZOOM_STEP = 0.25;
private ZoomAction zoomInAction;
@@ -146,8 +140,6 @@
undoManager = new OLAPUndoManager(olapSession);
pp = OLAPPlayPenFactory.createPlayPen(swingSession, this,
undoManager);
- newMenuBar = swingSession.getArchitectFrame().createNewMenuBar();
-
undoManager.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
// this can be called before initGUI() has had a chance to
create the frame
@@ -260,7 +252,7 @@
// gone otherwise
ArchitectSwingSessionContext context = swingSession.getContext();
if (context.isMacOSX()) {
- frame.setJMenuBar(newMenuBar);
+
frame.setJMenuBar(swingSession.getArchitectFrame().createNewMenuBar());
}
OLAPPlayPenFactory.setupOLAPMouseWheelActions(pp, this);