JDK-8098060 : [Dialogs] Expose underlying Window
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: controls
  • Affected Version: 8u40
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • Submitted: 2014-08-27
  • Updated: 2015-06-12
  • Resolved: 2014-08-27
Related Reports
Relates :  
Description
Since the new Dialog API allows to remove the Operating Systems (with initStyle) window decorations, it would be nice to re-add them with custom elements.
In order to do that we need access to the underlying Window. Otherwise we can not resize, reposition, etc. the Dialog accordingly.
Comments
@Steffen: It's good to see people actively switching from ControlsFX to JavaFX dialogs. I would be happy to work with you (in ControlsFX) to reintroduce the cross-platform style that we had there back into our ControlsFX release. Most of the code is there, it is just a matter of rewiring it (e.g. css styles, and writing code to initStyle and perhaps use a custom DialogPane that draws the cross platform styling (whose code can be found in earlier versions of the ControlsFX org.controlsfx.dialog.FXDialog class). Ping me via email and we can discuss this.
27-08-2014

We won't fix this for 8u40. There is a work around for the cases in question.
27-08-2014

I'm looking at the Dialog class right now and the ones that are missing are inconified, fullscreen and maximized. We are unlikely to add these as things like a full screen dialog seem weird. It is possible to get the Stage using something like "getDialogPane().getScene().getWindow()" although this is discouraged.
27-08-2014

Thanks for the feedback so far. We have a hard time porting our ControlsFX Dialogs over to the new JFX Dialogs API. One of the biggest issues so far is the Look and Feel: Switching from Cross-Platform LAF to OS native is currently not an option, so we have to add our own cross-platform window decorations.. We do not necessarily need to access the Window directly, but its properties (size, position, maximized, iconified, etc.) The properties should be roughly the same for both HeavyWeight and LightWeight Dialogs? Just in case you want to know which properties we are using of the Stage/Window: X-,Y- Coordinate Width Height Iconified Fullscreen Maximized Resizable (already available) And of course the usual WindowEvents (e.g. to send the close event).
27-08-2014

Hmmm ... I remember that we talk about this and agreed that the method would be added to forward to the underlying window. Did we miss this? @Steffen, we are not exposing the stage on purpose to leave the door open for the potential for lightweight dialogs.
27-08-2014

Not sure whether / how we want to do this for 8u40, but Jonathan can respond.
27-08-2014