Saving DockableFrame Layout

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

Saving DockableFrame Layout

Postby gerardebay » Thu Apr 19, 2007 3:26 pm

I have the scenario where I would like to save the state (positional) of a DockableFrame into a database and recreate it later. I do not want to save this information as bytes by serializing java objects. Can we save/restore the layout of a frames using the public methods? It appears there are public methods for getting the initial state but those methods do not provide all the information to restore the position of a frame. Set init mode, index, side do not entirely determine the frame position as it is dependent on the state of the container of the frame. PreviousState provides more extensive state information that could do this. Although DockContext provides methods like getClosePreviousState() as a public method to get the PreviousState, PreviousState itself is a package class not a public one. It doesn't appear that I can accurately recreate a frame layout having only DockingFrame information. It appears that to guarantee I can restore the layout I would also have to save the DockManager state which could be complicated as ContainerContainers are created. Since the information to do that doesn't appear to be publicly accessible the answer to my question seems no.
gerardebay
 
Posts: 1
Joined: Fri Apr 13, 2007 12:23 pm

Postby JIDE Support » Thu Apr 19, 2007 3:36 pm

It is not possible to restore one dockable frame's position (at least not exact) since a dockable frame's position could be affected by oither frames position. PreviousState is a class for this purpose but it only works within the context (such as what are the dockable frames within the same tabbed pane etc. You can see it since your company has JIDE source code). The only way to restore exactly is to call loadLayoutData or seveveral load layout methods which will load the whole layout, not just one dockable frame. In DockingManager, there is getLayoutRawData and setLayoutRawData. It is a byte array. You can use Base64 to encode it and save it to database and decoded back call setLayoutRawData to set the whole layout. This is the only way to gurantee an exact restore of the position.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 11 guests