summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2005-07-07 12:37:03 +0000
committerRoman Kennke <roman@kennke.org>2005-07-07 12:37:03 +0000
commit8822004a89d6ccbf129f773cc2cfb8bef1eb4139 (patch)
tree237f77846bb742b340bd14fa89bfa43ceaadd258 /gnu
parent891925a4b8e438f6761e0928c558f2c7e2ea3b8c (diff)
downloadclasspath-8822004a89d6ccbf129f773cc2cfb8bef1eb4139.tar.gz
2005-07-07 Roman Kennke <roman@kennke.org>
* gnu/java/awt/FocusManager.java: New class. Provides a concrete implementation of javax.swing.FocusManager so that we can support the old-style FocusManager in Swing and AWT. * gnu/classpath/SystemProperties.java: Add new system property gnu.java.awt.FocusManager that sets the class that should be used as the default FocusManager in AWT and Swing. * java/awt/KeyboardFocusManager.java (setCurrentKeyboardFocusManager): Use createFocusManager instead of creating the instance directly. (createFocusManager): New method. Instantiate a KeyboardFocusManager that is set by the system property gnu.java.awt.FocusManager. * javax/swing.FocusManager.java (constructor): Call super() here. (getCurrentManager): Return the current AWT KeyboardFocusManager here. (setCurrentManager): Set the current AWT KeyboardFocusManager here. (processKeyEvent): Removed method. This is no longer in the API. (focusNextComponent): Removed method. This is no longer in the API. (focusPreviousComponent): Removed method. This is no longer in the API.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/classpath/SystemProperties.java6
-rw-r--r--gnu/java/awt/FocusManager.java52
2 files changed, 58 insertions, 0 deletions
diff --git a/gnu/classpath/SystemProperties.java b/gnu/classpath/SystemProperties.java
index 524f04099..600e1a6c1 100644
--- a/gnu/classpath/SystemProperties.java
+++ b/gnu/classpath/SystemProperties.java
@@ -106,6 +106,12 @@ public class SystemProperties
if (defaultProperties.get("file.encoding") == null)
defaultProperties.put("file.encoding", "8859_1");
+ // Default to the Swing FocusManager so that the old-style Swing API
+ // for FocusManager can be supported without hardcoding it in AWT.
+ if (defaultProperties.get("gnu.java.awt.FocusManager") == null)
+ defaultProperties.put("gnu.java.awt.FocusManager",
+ "gnu.java.awt.FocusManager");
+
// XXX FIXME - Temp hack for old systems that set the wrong property
if (defaultProperties.get("java.io.tmpdir") == null)
defaultProperties.put("java.io.tmpdir",
diff --git a/gnu/java/awt/FocusManager.java b/gnu/java/awt/FocusManager.java
new file mode 100644
index 000000000..49b40bfc1
--- /dev/null
+++ b/gnu/java/awt/FocusManager.java
@@ -0,0 +1,52 @@
+/* FocusManager.java -- Provide Swing FocusManager API compatibility
+ Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.java.awt;
+
+/**
+ * This is a subclass of the otherwise abstract class
+ * {@link javax.swing.FocusManager}. Its sole purpose is to make the Swing
+ * FocusManager usable as a FocusManager in AWT, so that we can provide both
+ * the new (1.4) KeyboardFocusManager API and still support the older
+ * Swing FocusManager.
+ *
+ * @author Roman Kennke
+ */
+public class FocusManager
+ extends javax.swing.FocusManager
+{
+}