JIDE 3.5.15

com.jidesoft.docking
Class DockingLayoutLoader

java.lang.Object
  extended by com.jidesoft.swing.AbstractLayoutPersistence
      extended by com.jidesoft.docking.DockingLayoutLoader
All Implemented Interfaces:
LayoutPersistence

public class DockingLayoutLoader
extends AbstractLayoutPersistence

DockingLayoutLoader is a utility that loads a layout produced by docking framework without actually loading it into a DockingManager. You can use it to find out what dockable frames are in the layout without loading it.

Here is how you use it.

 DockingLayoutLoader loader = new DockingLayoutLoader();
 loader.setProfileKey("jidesoft");
 loader.loadLayoutData();
 
After that, you can call loader's getContext() to find out what dockable frames are in the layout and what initial states they are in.


Field Summary
 
Fields inherited from class com.jidesoft.swing.AbstractLayoutPersistence
_layoutDirectory, _loadingLayoutData, _profileKey, _useFrameBounds, _useFrameBoundsSet, _useFrameState, _useFrameStateSet, _usePref, _version, DEFAULT_PROFILE_NAME, LAYOUT_COUNT_STRING, LAYOUT_POSTFIX, MAX_PREF_BYTE_ARRAY_LENGTH, PROPERTY_PROFILE_KEY, PROPERTY_USE_PREF, PROPERTY_VERSION, V2004, V2005_09
 
Fields inherited from interface com.jidesoft.swing.LayoutPersistence
ATTRIBUTE_PERSISTENCE_NAME, NODE_LAYOUT_PERSISTENCE
 
Constructor Summary
DockingLayoutLoader()
           
 
Method Summary
 void beginLoadLayoutData()
          Starts a process to add/remove frame or dockable bar without showing on screen immediately.
 Rectangle getBounds()
           
 Map<String,DockContext> getContexts()
           
 int getState()
           
 boolean isLoadDataSuccessful()
          Checks if the loadLayoutFrom(InputStream in) method load successfully from the input stream (false indicates that it called resetToDefault to load the layout.) This method can be called immediately after the loadLayoutFrom(InputStream in) call to determine if a specific LayoutPersistence was forced to call resetToDefault.
 void loadInitialLayout(Document layoutDocument)
          Load initial layout from an initial layout file designed by Visual Designer.
 boolean loadLayoutFrom(Document document)
          Load layout data from an Node that specified as node parameter.
 boolean loadLayoutFrom(InputStream in)
          Load layout data from an InputStream that specified as in parameter.
static void main(String[] args)
           
 void resetToDefault()
          Resets layout.
 void saveLayoutTo(Document document)
          Save layout data to a Document that specified as document parameter.
 void saveLayoutTo(OutputStream out)
          Save layout data to an OutputStream that specified as out parameter.
 
Methods inherited from class com.jidesoft.swing.AbstractLayoutPersistence
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getAvailableLayouts, getLayoutDirectory, getLayoutPersistenceName, getLayoutRawData, getLoadCallback, getProfileKey, getPropertyChangeListeners, getPropertyChangeListeners, getSaveCallback, getVersion, getXmlEncoding, isLast, isLayoutAvailable, isLayoutDataVersionValid, isLoadingLayoutData, isNeedFormatCheck, isUsePref, isVersionCompatible, isXmlFormat, loadInitialLayout, loadInitialLayout, loadLayoutData, loadLayoutDataFrom, loadLayoutDataFromFile, removeLayout, removePropertyChangeListener, removePropertyChangeListener, saveLayoutData, saveLayoutDataAs, saveLayoutDataToFile, setLast, setLayoutDirectory, setLayoutPersistenceName, setLayoutRawData, setLoadCallback, setLoadingLayoutData, setNeedFormatCheck, setProfileKey, setSaveCallback, setUseFrameBounds, setUseFrameState, setUsePref, setVersion, setXmlEncoding, setXmlFormat, shouldUseFrameBounds, shouldUseFrameState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DockingLayoutLoader

public DockingLayoutLoader()
Method Detail

loadInitialLayout

public void loadInitialLayout(Document layoutDocument)
Description copied from interface: LayoutPersistence
Load initial layout from an initial layout file designed by Visual Designer. To use this method, you need to load the initial layout into Document which represents XML document.

Parameters:
layoutDocument - the Document contains an initial layout.

loadLayoutFrom

public boolean loadLayoutFrom(Document document)
Description copied from interface: LayoutPersistence
Load layout data from an Node that specified as node parameter. If any exception happens during the read, it will call resetLayout() to use default layout.

Parameters:
document - the Document where the layout data will be read from
Returns:
boolean true if load successfully. Otherwise false.

loadLayoutFrom

public boolean loadLayoutFrom(InputStream in)
Description copied from interface: LayoutPersistence
Load layout data from an InputStream that specified as in parameter. If any exception happens during the read, it will call resetLayout() to use default layout.

Parameters:
in - the InputStream where the layout data will be read from.
Returns:
boolean did it load successfully from the input stream (false indicates that it called resetToDefault to load the layout.)

isLoadDataSuccessful

public boolean isLoadDataSuccessful()
Description copied from interface: LayoutPersistence
Checks if the loadLayoutFrom(InputStream in) method load successfully from the input stream (false indicates that it called resetToDefault to load the layout.) This method can be called immediately after the loadLayoutFrom(InputStream in) call to determine if a specific LayoutPersistence was forced to call resetToDefault.

Returns:
boolean did it load successfully from the input stream (false indicates that it called resetToDefault to load the layout.)

saveLayoutTo

public void saveLayoutTo(Document document)
                  throws ParserConfigurationException
Description copied from interface: LayoutPersistence
Save layout data to a Document that specified as document parameter.

Parameters:
document - the Document where the layout data will be written to
Throws:
ParserConfigurationException - if any parser exception happens when writing to the document.

saveLayoutTo

public void saveLayoutTo(OutputStream out)
                  throws IOException
Description copied from interface: LayoutPersistence
Save layout data to an OutputStream that specified as out parameter.

Parameters:
out - the OutputStream where the layout data will be written to.
Throws:
IOException - if any IO exception happens when writing to the OutputStream.

resetToDefault

public void resetToDefault()
Description copied from interface: LayoutPersistence
Resets layout. It could be called either when there is no saved layout or the saved layout file is corrupted.


beginLoadLayoutData

public void beginLoadLayoutData()
Description copied from interface: LayoutPersistence
Starts a process to add/remove frame or dockable bar without showing on screen immediately. Any call to loadLayoutDataXxx methods or resetToDefault() will mark the process.


getBounds

public Rectangle getBounds()

getState

public int getState()

getContexts

public Map<String,DockContext> getContexts()

main

public static void main(String[] args)

JIDE 3.5.15