![]() |
|
|||||||
| Registrieren | Benutzerliste | Interessengemeinschaften | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren | ||
| Java Link Base | Wiki | NoPaste | Chat | Boardregeln | F.A.Q. |
| DockingFrames DockingFrames An extension of Swing, used to flexibly arrange windows. - Ist eine Erweiterung von Swing, mit der flexibel Panels angeordnet werden können. |
![]() |
|
|
Themen-Optionen | Thema durchsuchen |
|
|
#1 |
|
Registriert seit: 29.07.2009
Beiträge: 28
|
Hi,
i did a application which consists of many dockables. I also save the layout into a string to have the same layout when the application starts up. My problem is that the dockables which got closed before saving, do not show up at the same position they were shown on the previous startup if i choose to show them again. Is there any way to cache the locations of closed dockables and apply them at the next startup of the application? Thanks for any help! Greetings -chris- |
|
|
|
|
|
#2 |
|
Moderator
|
Depends on what exactly you are doing.
As long as a Dockable remains registered at a CControl its position remains in memory, even if the Dockable is not visible (calling CControl.remove or DockFrontend.remove clears the position). This position information gets stored if you use one of the standard methods to create your config-file, like CControl.writeXML. If you load the layout this information gets loaded if - the Dockable is known to the CControl (you called "add"), or if - you added a SingleCDockableBackupFactory to the CControl or if - you did set a MissingCDockableStrategy which tells the CControl explicitly to store the information. Did you do any of these things? How do you store the layout exactly?
__________________
|
|
|
|
|
|
#3 |
|
Registriert seit: 29.07.2009
Beiträge: 28
|
Hi Beni,
thanks for your reply! I load the perspective as follows on an application start Code:
XElement xml = XIO.read(new StringReader(userProfile.getPerspectiveXML()));
m_dockControl.readXML(xml);
m_dockControl.load("current");
But i don't now how to apply the MissingCDockableStrategy, maybe this is the missing link. Can you provide a small example on how to use this MissingCDockableStrategy? Many thanks in advance. Greetings, -chris- |
|
|
|
|
|
#4 |
|
Moderator
|
Could you please post the xml-file itself? It may contain valuable information. I would also need to know the id (key) of some of the Dockables whose location does not get cached.
You can try calling "m_dockControl.setMissingStrategy( MissingCDockableStrategy.STORE );" directly after you created your "CControl". This will tell "m_dockControl" not to throw away *any* layout information. If this does not help, then the layout information never got stored in the first place. I wrote some small application to check and make absolutely sure that location-caching works - yes it does. Would you please copy the following lines (line 66 to 82 in my test application) to your application and:
Lines to copy: Java Code:
Entire application Java Code:
__________________
|
|
|
|
|
|
#5 |
|
Registriert seit: 29.07.2009
Beiträge: 28
|
Hi Beni,
i pasted your code as you described. Here's the outcome Code:
###Before calling dockControl.load("current");###
single library: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single main: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single remote: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single rfb: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@3e1
single srv: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single tvcontrol: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single cfg: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single sched: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
###After calling dockControl.load("current");###
single library: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single main: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single remote: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single rfb: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@3e1
single srv: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single tv: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single cfg: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
single sched: ccontrol center bibliothek.gui.dock.station.split.SplitDockPlaceholderProperty@1f
Java Code:
So this was my fault. I'm very sorry for that. Thanks again very much for all your help!! Greetings, -chris- |
|
|
|
|
|
#6 |
|
Moderator
|
Well... such things happen to all of us
![]()
__________________
|
|
|
|
![]() |
| Lesezeichen |
| Stichworte |
| - |
| Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1) | |
| Themen-Optionen | Thema durchsuchen |
|
|