Hi,
I am trying to save and persist the DF resources using:
CControl control;
control.getResources().writeFile(file);
Then when application restarts, I load the resources using:
control.getResources().readFile(file);
bIsRestored = true;
and then:
control.add( sourceTreeDockable );
control.add( projInfoDockable );
control.add( scanReportDockable );
control.add( sourceViewerDockable );
control.add( statusDockable );
if (bIsRestored) {
sourceTreeDockable.setVisible(true);
projInfoDockable.setVisible(true);
scanReportDockable.setVisible(true);
sourceViewerDockable.setVisible(true);
statusDockable.setVisible(true);
} else {
CGrid grid = new CGrid( m_control );
grid.add( 0, 0, 0.2, 1.0, sourceTreeDockable );
grid.add( 0, 1, 0.2, 1.0, projInfoDockable );
grid.add( 1, 0, 1.0, 0.9, scanReportDockable );
grid.add( 1, 1, 1.0, 0.9, sourceViewerDockable );
grid.add( 1, 2, 1.0, 0.2, statusDockable );
m_control.getContentArea().deploy( grid );
}
But in first setVisible(true), I am getting NPE:
java.lang.NullPointerException
at bibliothek.gui.dock.facile.action.StateManager.normalize(Unknown Source)
at bibliothek.gui.dock.facile.action.StateManager.change(Unknown Source)
at bibliothek.gui.dock.facile.action.StateManager.change(Unknown Source)
at bibliothek.gui.dock.facile.action.StateManager.transition(Unknown Source)
at bibliothek.gui.dock.support.action.ModeTransitionManager.goIn(Unknown Source)
at bibliothek.gui.dock.support.action.ModeTransitionManager.setMode(Unknown Source)
at bibliothek.gui.dock.common.intern.CStateManager.setMode(Unknown Source)
at bibliothek.gui.dock.common.intern.CStateManager.ensureValidLocation(Unknown Source)
at bibliothek.gui.dock.common.CControl$Access.show(Unknown Source)
at bibliothek.gui.dock.common.intern.AbstractCDockable.setVisible(Unknown Source)
What am I doing wrong and what is the proper way to restore and display the DF resources/layout?
Thanks for the great docking framework!
Lubos