[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Patch: Text components home and end actions
From: |
Lillian Angel |
Subject: |
Re: [cp-patches] Patch: Text components home and end actions |
Date: |
Wed, 21 Dec 2005 11:51:27 -0500 |
Key Bindings for text components are all fixed.
2005-12-20 Lillian Angel <address@hidden>
* javax/swing/plaf/basic/BasicLookAndFeel.java
(initClassDefaults): Fixed typo.
(initComponentDefaults): Removed keyBindings defaults for
Text*. Added focusInputMap for Text*.
* javax/swing/plaf/basic/BasicTextUI.java
(installKeyBoardActions): Added code to load the focusInputMap
and install all the actions for each key.
(ActionListenerProxy): New class implemented.
(converModifiers): New method to convert the modifiers.
(getActionMap): Removed function. Not needed.
(createActionMap): Likewise.
* javax/swing/text/JTextComponent.java
(JTextComponent): Removed code to load the keymap.
On Wed, 2005-12-21 at 13:50 +0100, Roman Kennke wrote:
> Hi Lillian,
>
> I would prefer the more efficient (and more correct?) solution and fix
> the viewToModel() methods. I don't really care if it doesn't work yet
> because of the viewToModel() methods not working properly, this way we
> have some more reasons to fix those.
>
> Also, in JTextComponent you directly create KeyBindings for the new
> Actions. This doesn't sound right, IMO this should be done by the UI
> (BasicTextUI). The UIDefaults should have an array of InputMap-like
> bindings (e.g. in TextField.focusInputMap) that should then be loaded
> into an InputMap (using LookAndFeel.loadKeyBindings()) and installed in
> the text component (using SwingUtilities.replaceUIInputMap()). Direct
> key bindings are not what we want.
>
> Could you please fix that? (At least the keybinding thing?) Also note
> that there is a getActionMap() method in BasicTextUI that really
> shouldn't be there. We should figure out how to properly install an
> ActionMap on the text component, I would think that we fetch
> getActions() from JTextComponent and create an ActionMap out of it by
> fetching the NAME from the Action instances and put them into an
> ActionMap using the NAME as key.
>
> Cheers, Roman
>
patch.diff
Description: Text Data