On Aug 25, 2009, at 6:27 AM, Anthony Petrov wrote:

Hello,

The following change request has been filed some time ago:

6402325 (Swing toolbars vs native toolbars on Windows)
http://bugs.sun.com/view_bug.do?bug_id=6402325

The RFE proposes to tag toolbar windows so that the native system could
modify their visual appearance and behavior in order to increase the
native fidelity of Java applications. So, what about:

**************************************************

public enum java.awt.Window.Type {
  NORMAL,
  UTILITY
}

public void java.awt.Window.setType(Type type);
public Type java.awt.Window.getType();

**************************************************

?

Regarding implementation details:

1. The NORMAL windows are, well, the normal top-level windows - just
like all windows currently behave in Java.

2. UTILITY: may have smaller decorations, are not focusable yet display
their title-bar in the focused state when their owner frame is focused
(given the native system supports that). On MS Windows this basically
means setting the WS_EX_PALETTEWINDOW or just plain WS_EX_TOOLWINDOW
extended style (see [1]). On X11 we can set the _NET_WM_WINDOW_TYPE hint to the _NET_WM_WINDOW_TYPE_TOOLBAR or _NET_WM_WINDOW_TYPE_UTILITY, and let the window manager decide how to treat these windows ([2]).

The solution is open to further extending the number of supported window types in the future (POPUP, DOCK, NOTIFICATION, DND - to name a few).

Opinions?

Java on Mac OS X already implements similar functionality with a Swing client property "Window.style" -> "small", so we welcome this addition to the formal Java API specification.

To on Mac OS X, the underlying AppKit framework does not support changing the NSWindow style mask on the fly. Could the specification be written to require the type to be set prior to the native peer becoming realized?

Thanks,
Mike Swingler
Java Runtime Engineer
Apple Inc.

Reply via email to