Imported GNU Classpath 0.92
2006-08-14 Mark Wielaard <mark@klomp.org> Imported GNU Classpath 0.92 * HACKING: Add more importing hints. Update automake version requirement. * configure.ac (gconf-peer): New enable AC argument. Add --disable-gconf-peer and --enable-default-preferences-peer to classpath configure when gconf is disabled. * scripts/makemake.tcl: Set gnu/java/util/prefs/gconf and gnu/java/awt/dnd/peer/gtk to bc. Classify gnu/java/security/Configuration.java as generated source file. * gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java, gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java, gnu/java/lang/management/VMClassLoadingMXBeanImpl.java, gnu/java/lang/management/VMRuntimeMXBeanImpl.java, gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java, gnu/java/lang/management/VMThreadMXBeanImpl.java, gnu/java/lang/management/VMMemoryMXBeanImpl.java, gnu/java/lang/management/VMCompilationMXBeanImpl.java: New VM stub classes. * java/lang/management/VMManagementFactory.java: Likewise. * java/net/VMURLConnection.java: Likewise. * gnu/java/nio/VMChannel.java: Likewise. * java/lang/Thread.java (getState): Add stub implementation. * java/lang/Class.java (isEnum): Likewise. * java/lang/Class.h (isEnum): Likewise. * gnu/awt/xlib/XToolkit.java (getClasspathTextLayoutPeer): Removed. * javax/naming/spi/NamingManager.java: New override for StackWalker functionality. * configure, sources.am, Makefile.in, gcj/Makefile.in, include/Makefile.in, testsuite/Makefile.in: Regenerated. From-SVN: r116139
This commit is contained in:
parent
abab460491
commit
ac1ed908de
1294 changed files with 99479 additions and 35933 deletions
|
@ -163,7 +163,13 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager
|
|||
if (e.id == WindowEvent.WINDOW_ACTIVATED)
|
||||
setGlobalActiveWindow (target);
|
||||
else if (e.id == WindowEvent.WINDOW_GAINED_FOCUS)
|
||||
setGlobalFocusedWindow (target);
|
||||
{
|
||||
setGlobalFocusedWindow (target);
|
||||
FocusTraversalPolicy p = target.getFocusTraversalPolicy();
|
||||
Component toFocus = p.getInitialComponent(target);
|
||||
if (toFocus != null)
|
||||
toFocus.requestFocusInWindow();
|
||||
}
|
||||
else if (e.id != WindowEvent.WINDOW_LOST_FOCUS
|
||||
&& e.id != WindowEvent.WINDOW_DEACTIVATED)
|
||||
return false;
|
||||
|
@ -173,51 +179,18 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager
|
|||
}
|
||||
else if (e instanceof FocusEvent)
|
||||
{
|
||||
Component target = (Component) e.getSource ();
|
||||
FocusEvent fe = (FocusEvent) e;
|
||||
Component target = fe.getComponent ();
|
||||
|
||||
boolean retval = false;
|
||||
if (e.id == FocusEvent.FOCUS_GAINED)
|
||||
{
|
||||
if (! (target instanceof Window))
|
||||
{
|
||||
if (((FocusEvent) e).isTemporary ())
|
||||
setGlobalFocusOwner (target);
|
||||
else
|
||||
setGlobalPermanentFocusOwner (target);
|
||||
}
|
||||
|
||||
// Keep track of this window's focus owner.
|
||||
|
||||
// Find the target Component's top-level ancestor. target
|
||||
// may be a window.
|
||||
Container parent = target.getParent ();
|
||||
|
||||
while (parent != null
|
||||
&& !(parent instanceof Window))
|
||||
parent = parent.getParent ();
|
||||
|
||||
// If the parent is null and target is not a window, then target is an
|
||||
// unanchored component and so we don't want to set the focus owner.
|
||||
if (! (parent == null && ! (target instanceof Window)))
|
||||
{
|
||||
Window toplevel = parent == null ?
|
||||
(Window) target : (Window) parent;
|
||||
|
||||
Component focusOwner = getFocusOwner ();
|
||||
if (focusOwner != null
|
||||
&& ! (focusOwner instanceof Window))
|
||||
toplevel.setFocusOwner (focusOwner);
|
||||
}
|
||||
retval = handleFocusGained(fe);
|
||||
}
|
||||
else if (e.id == FocusEvent.FOCUS_LOST)
|
||||
{
|
||||
if (((FocusEvent) e).isTemporary ())
|
||||
setGlobalFocusOwner (null);
|
||||
else
|
||||
setGlobalPermanentFocusOwner (null);
|
||||
retval = handleFocusLost(fe);
|
||||
}
|
||||
|
||||
redispatchEvent(target, e);
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (e instanceof KeyEvent)
|
||||
|
@ -256,6 +229,95 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles FOCUS_GAINED events in {@link #dispatchEvent(AWTEvent)}.
|
||||
*
|
||||
* @param fe the focus event
|
||||
*/
|
||||
private boolean handleFocusGained(FocusEvent fe)
|
||||
{
|
||||
Component target = fe.getComponent ();
|
||||
|
||||
// If old focus owner != new focus owner, notify old focus
|
||||
// owner that it has lost focus.
|
||||
Component oldFocusOwner = getGlobalFocusOwner();
|
||||
if (oldFocusOwner != null && oldFocusOwner != target)
|
||||
{
|
||||
FocusEvent lost = new FocusEvent(oldFocusOwner,
|
||||
FocusEvent.FOCUS_LOST,
|
||||
fe.isTemporary(), target);
|
||||
oldFocusOwner.dispatchEvent(lost);
|
||||
}
|
||||
|
||||
setGlobalFocusOwner (target);
|
||||
if (target != getGlobalFocusOwner())
|
||||
{
|
||||
// Focus transfer was rejected, like when the target is not
|
||||
// focusable.
|
||||
dequeueKeyEvents(-1, target);
|
||||
// FIXME: Restore focus somehow.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! fe.isTemporary())
|
||||
{
|
||||
setGlobalPermanentFocusOwner (target);
|
||||
if (target != getGlobalPermanentFocusOwner())
|
||||
{
|
||||
// Focus transfer was rejected, like when the target is not
|
||||
// focusable.
|
||||
dequeueKeyEvents(-1, target);
|
||||
// FIXME: Restore focus somehow.
|
||||
}
|
||||
else
|
||||
{
|
||||
redispatchEvent(target, fe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles FOCUS_LOST events for {@link #dispatchEvent(AWTEvent)}.
|
||||
*
|
||||
* @param fe the focus event
|
||||
*
|
||||
* @return if the event has been handled
|
||||
*/
|
||||
private boolean handleFocusLost(FocusEvent fe)
|
||||
{
|
||||
Component currentFocus = getGlobalFocusOwner();
|
||||
if (currentFocus != fe.getOppositeComponent())
|
||||
{
|
||||
setGlobalFocusOwner(null);
|
||||
if (getGlobalFocusOwner() != null)
|
||||
{
|
||||
// TODO: Is this possible? If so, then we should try to restore
|
||||
// the focus.
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! fe.isTemporary())
|
||||
{
|
||||
setGlobalPermanentFocusOwner(null);
|
||||
if (getGlobalPermanentFocusOwner() != null)
|
||||
{
|
||||
// TODO: Is this possible? If so, then we should try to
|
||||
// restore the focus.
|
||||
}
|
||||
else
|
||||
{
|
||||
fe.setSource(currentFocus);
|
||||
redispatchEvent(currentFocus, fe);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean enqueueKeyEvent (KeyEvent e)
|
||||
{
|
||||
Iterator i = delayRequests.iterator ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue