I’m fiddling with externalized windows. I’m using DefaultScreenDockWindowFactory with Kind.FRAME and setting show dock title to true (title text is explicitely nulled on the factory). Undecorated is set to false.
Unfortunately the created JFrames have no title.
Digging the code lead me to AbstractScreenDockWindow.setDockable() as the possible point where the title of the frame should be updated, but that method calls updateTitleIcon() twice but doesn’t call updateTitleText().
Changing one updateTitleIcon() to updateTitleText() updates the title of the JFrame correctly. Is it possible that the second updateTitleIcon() call is a copy&paste bug?
By the way the title of the JFrame is correct only while it contains only a single dockable. If it contains more than one dockable in a tabbed window the title of the JFrame becames empty. Is it possible to somehow merge all the titles of the dockables and show it on the JFrame?
Yeah, that was a bug… :mad: I’ll upload a repaired version on the weekend.
As for the second question: the title you (do not) see is the title of the StackDockStation that is created when combining some Dockables. You could create your own window-class. Since that class knows when a Dockable is present (setDockable…) it could add listeners to find out when Dockables are added and removed or when their title changes. It would update its title whenever it receives some event. I can write you some code if you need it.
You can also set a default title-text for all DockStations: use the key “PropertyKey.DOCK_STATION_TITLE” and CControl#putProperty to set the default title.
So should I extend eg. ScreenDockFrame in a way that it handles in setDockable(…) the case when a StackDockStation is set? Then which kind of listener should I use? (Eer, sorry, currently I’m lost inside the Eclipse theme… I’ll post some fixes to it later. )
A DockStationListener will inform you when Dockables are added or removed from the station. And a DockableListener will inform you when the title of a Dockable changed (you would have to add this listener to each child of the station).