Hi,
I have an application that can save and load configurations. It stores two configuration files - one for the docking resources and one for the application resources.
I have a working area that contains dockables. If I load anything that was saved with anything other than the first tab selected, issues arise with the configs becoming out of sync. A quick solution I am attempting to use is to force the first tab to always be the favorite/focused child when starting up.
I am having trouble with the mechanisms that should be setting the focused child. I have tried the following:
- workingArea.getStation().getController().setFocusedDockable( … )
- workingArea.getStation().setFrontDockable( … )
- dockable.toFront()
- applying the above in a invokeLater
Another issue that is happening along with this one is with setTitleIcon. I have an Icon that indicates which tab has focus. All other tabs have no icon (null, IconHandling.KEEP_NULL_ICON). These are set in the same area above and from other focus events. For some reason, the icon for the favorite child (the first one) is not being set (works fine when program is running, just not during deserialization). I am using dockable.setTitleIcon( … ) on a CDockable.
I traced through the code in the debugger and discovered that the else branch in the DefaultFocusController.run method is taken ( and hence execute is not called ).
I also found that the getTab( dockable ) in the CombinedStackDockComponent.Meta.forward() is null. Although I don’t think this is relevent, the menu is also null. Hence it appears that my icon is never set. This getTab method does not return null during normal program operation - instead it is an EclipseTab.
The deserialization occurs after the program creates the docking components, but before the main frame becomes visible. My findings suggest that the tab part of the dockable does not exist / is not configured properly at the time that I try to synchronize the client and docking configurations after deserialization. It would be messy to attempt to wait until the main frame is visible to synchronize.
So basically what I’m asking is a I need a way to set the favorite / focused child in a working area during deserialization of my program. I’m not sure if I am doing something wrong, or if there is some timing issue that is arising.
Thanks,
Mark