This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When defining a mode it's possible to set it's default state. During the runtime it's not possible to find out in which state you are, except for some hacks (comparing parent of TopComponent to Main Frame ) or through the friend API of core.windows (ModeImpl or WindowSystemImpl). I think since it's part of the mode definition it should also be exposed via the Mode class. My concrete use case was that I needed it for the implementation of the Tabbed Interface in order to set popupmenu actions for the TopComponent depending on the modes state (http://www.netbeans.org/issues/show_bug.cgi?id=150393). Workaround: boolean docked = SwingUtilities.getWindowAncestor( topcomponent ) == WindowManager.getDefault().getMainWindow();
i'm not convinced that the 'state' should be part of the generic window system api. it seem more like an attribute of a concrete ws implementation.
As I see it the state is already part of the public API: You can set it's default state declaratively to "joined" or "separated" in the xml configuration file.
> not convinced that the 'state' should be part of the generic window system api Are you suggesting that docked = SwingUtilities.getWindowAncestor( topcomponent ) == WindowManager.getDefault().getMainWindow(); is the recommended method for determining this information? Is there some other approach/api that you are considering?