Quaqua 8.0 2011-10-02

ch.randelshofer.quaqua.osx
Class OSXSheetSupport

java.lang.Object
  extended by ch.randelshofer.quaqua.osx.OSXSheetSupport

public class OSXSheetSupport
extends java.lang.Object

OSXSheetSupport provides support for native JDialogs for Java 5 and lower.

See showAsSheet(JDialog) and hideSheet(JDialog) for further information.

Please note: Sheets shown by this classed have no resize indicator and block their owner window from user interaction.

Version:
$Id: OSXSheetSupport.java 106 2009-07-19 20:34:09Z fedr $
Author:
Felix Draxler

Method Summary
static void hideSheet(javax.swing.JDialog sheet)
          Hides a sheet.
static boolean showAsSheet(javax.swing.JDialog sheet)
          Shows a sheet on the given owner and immediately returns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

showAsSheet

public static boolean showAsSheet(javax.swing.JDialog sheet)
Shows a sheet on the given owner and immediately returns.

The native part of this method gets the NSWindow peers from the sheet and its owner. Then it tells the shared NSApplication to show the sheet as a standard native sheet.
See NSApplication reference

You have to call setVisible(true) after showing the sheet to enable lightweight components. That method must not have been called before this method.

In addition, hideSheet(JDialog) must be called to hide the sheet before you call setVisible(false) on it.

The dialog must be undecorated.

JSheet handles all those details, but the method is enabled for any JDialog.

Parameters:
sheet -
Returns:
true, if showing the sheet succeeds. false otherwise.
See Also:
Dialog.setVisible(boolean), hideSheet(JDialog), Dialog.setUndecorated(boolean)

hideSheet

public static void hideSheet(javax.swing.JDialog sheet)
Hides a sheet.

See NSApplication reference

Parameters:
sheet - The sheet to hide.
See Also:
showAsSheet(JDialog)

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.