diff options
| author | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
|---|---|---|
| committer | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
| commit | 8f523f3a1047919d3563daf1ef47ba87336ebe89 (patch) | |
| tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/javax/swing/ComponentInputMap.java | |
| parent | 02e549bfaaec38f68307e7f34e46ea57ea1809af (diff) | |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
From-SVN: r107049
Diffstat (limited to 'libjava/classpath/javax/swing/ComponentInputMap.java')
| -rw-r--r-- | libjava/classpath/javax/swing/ComponentInputMap.java | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/libjava/classpath/javax/swing/ComponentInputMap.java b/libjava/classpath/javax/swing/ComponentInputMap.java index f95c3104535..28aa8e22cf6 100644 --- a/libjava/classpath/javax/swing/ComponentInputMap.java +++ b/libjava/classpath/javax/swing/ComponentInputMap.java @@ -78,7 +78,8 @@ public class ComponentInputMap extends InputMap public void put(KeyStroke keystroke, Object value) { super.put(keystroke, value); - // FIXME: Notify component. + if (component != null) + component.updateComponentInputMap(this); } /** @@ -87,7 +88,8 @@ public class ComponentInputMap extends InputMap public void clear() { super.clear(); - // FIXME: Notify component. + if (component != null) + component.updateComponentInputMap(this); } /** @@ -98,7 +100,8 @@ public class ComponentInputMap extends InputMap public void remove(KeyStroke keystroke) { super.remove(keystroke); - // FIXME: Notify component. + if (component != null) + component.updateComponentInputMap(this); } /** @@ -111,14 +114,19 @@ public class ComponentInputMap extends InputMap */ public void setParent(InputMap parentMap) { - if (! (parentMap instanceof ComponentInputMap)) - throw new IllegalArgumentException(); - - if (((ComponentInputMap) parentMap).getComponent() != component) - throw new IllegalArgumentException(); + if (parentMap != null && !(parentMap instanceof ComponentInputMap)) + throw new IllegalArgumentException("ComponentInputMaps can only have " + + "ComponentInputMaps for parents"); + + if (parentMap != null && + ((ComponentInputMap) parentMap).getComponent() != component) + throw new + IllegalArgumentException("ComponentInputMaps' parents must " + + "be associated with the same JComponents"); super.setParent(parentMap); - // FIXME: Notify component. + if (component != null) + component.updateComponentInputMap(this); } /** |
