Cannot remove Bindings from InputMap

Hi all,
i'm very frustrated, because for days i try to change the default behaviour of a Borland jdbTextField, which extends JTextField with no success.
First i elicited that the keys i wanted to remove are part of the parent of the InputMap of the jdbTextField.
I want to remove the bindings for the following two keyStrokes:
KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)
KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0)
Since both keys are elements of
jdbTextField.getInputMap(JComponent.WHEN_FOCUSED).getParent().keys()
I was shure i could do
jdbTextField.getInputMap(JComponent.WHEN_FOCUSED).getParent()
.remove( KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0) )
and respectively
.remove( KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0) )
but this didn't change anything.
The .getParent().keys().length is still 6 - before and after the removings.
In a next step i tried to replace the 6 entries holding InputMap with a 4 entries holding InputMap by putting all keyStroke/Object - pairs ecept those for VK_PAGE_DOWN and VK_PAGE_UP to a newly created InputMap-Object.
The creation of the new InputMap:
int i;
InputMap parentsParent,
globalDefaultJdbTextFieldInputMapParent ,
globalJdbTextFieldInputMapParent;
KeyStroke[] dataSetKeys;
globalDefaultJdbTextFieldInputMapParent = jdbTextField
.getInputMap(JComponent.WHEN_FOCUSED).getParent();
if (globalDefaultJdbTextFieldInputMapParent != null) {
dataSetKeys = globalDefaultJdbTextFieldInputMapParent.keys();
for (i = dataSetKeys.length - 1; i >= 0; i--) {
if ( (dataSetKeys.getKeyCode() != KeyEvent.VK_PAGE_DOWN)
&& (dataSetKeys[i].getKeyCode() != KeyEvent.VK_PAGE_UP)) {
if (globalDefaultJdbTextFieldInputMapParent
.get(dataSetKeys[i]) != null) {
globalJdbTextFieldInputMapParent
.put(dataSetKeys[i], globalDefaultJdbTextFieldInputMapParent
.get(dataSetKeys[i]));
System.out.println("One InputMapping added: " +
globalDefaultJdbTextFieldInputMapParent
.get(dataSetKeys[i]).toString());
The newly created InputMap has four entries!
And then i replaced the Parent-InputMap and the Parents Parent-InputMap like this:
parentsParent = jdbTextField.getInputMap(JComponent.WHEN_FOCUSED).getParent().getParent();
jdbTextField.getInputMap(JComponent.WHEN_FOCUSED).setParent(
globalJdbTextFieldInputMapParent);
jdbTextField.getInputMap(JComponent.WHEN_FOCUSED).getParent().setParent(parentsParent);
After this action i could no longer input any keystrokes in those fields i replaced the parent-InputMap.
I could only click into the field, but thats all. Nothing else.
>>>>>>>>>>>>>>>>>>
I searched the newsgroups and found some articles and did the proposed actions, what means not trying to remove a keystroke but leaving the parent-InputMaps as they are and adding keys with null action to the Components InputMap.
I tried this:
InputMap im;
im = jdbTextField.getInputMap(JComponent.WHEN_FOCUSED);
im.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "Nothing - P");
im.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "Nothing - P");
jdbTextField.getActionMap().put( "Nothing - P", null);
With this solution i am able to populate the textField with data, but there is still the default behaviour of the VK_PAGE_UP and _DOWN - Keys.
CAN ANYONE PLEASE EXPLAIN WHY THIS F... DOESN'T WORK?
And what to do to remove the default Bindings?
TIA,
Richard

o.k., after your first advice i tried the following:
if ( jdbTextField.getInputMap(JComponent.WHEN_FOCUSED)
.get(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)) != null){
System.out.println("WHEN_FOCUSED");
} else
if ( jdbTextField.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
.get(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)) != null){
System.out.println("WHEN_ANCESTOR_OF_FOCUSED_COMPONENT");
} else
if ( jdbTextField.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
.get(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)) != null){
System.out.println("WHEN_IN_FOCUSED_WINDOW");
} else
if ( jdbTextField.getInputMap(JComponent.WHEN_FOCUSED).getParent()
.get(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)) != null){
System.out.println("WHEN_FOCUSED in Parent");
} else
if ( jdbTextField.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent() != null){
if ( jdbTextField.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).getParent()
.get(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)) != null){
System.out.println("WHEN_ANCESTOR_OF_FOCUSED_COMPONENT in Parent");
} else
if ( jdbTextField.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).getParent() != null){
if ( jdbTextField.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).getParent()
.get(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)) != null){
System.out.println("WHEN_IN_FOCUSED_WINDOW in Parent");
And - as if you smelled it - there was no response!
The get - method of all the InputMaps of any condition always returns null!!!
So, that is a bad bug, i think:
While inputMap.keys() returns an array of KeyStroke's,
neither inputMap.get( inputMap.keys()[x] )
nor inputMap.remove( inputMap.keys()[x] )
does anything or returns any from null different value.
The question here is:
Why does a KeyStroke[] - Array is returned, while the InputMaps internal property arrayTable is null?????????????????????
This must be a bug.
Next i'll try what you postet about the UI ....
Thanks so far, you'll hear from me ...
TIA,
Richard

Similar Messages

  • How do I remove an old phone number from my macbook imessage. My apple ID does not show the number anymore but I cannot remove it from the imessage accounts. Its driving me mad !

    Can someone please help me to remove an iphone telephone number from my imessage application. I no longer have a phone which I registered on my apple ID as a second phone. I have been on my apple ID and it does not seem to be there but cannot remove it from imessage, which still has it as an option to connect to. I am concerned that someone else who inherite this old phone will see my messages if I accidentally enable it again. I have read and re-read various postings and tried all options given but no luck, the **** thing stays there.....

    Hey Chappers64!
    Here is an article that will help you with this issue:
    iOS: Deactivating iMessage
    http://support.apple.com/kb/ts5185
    If you have already tried these steps, you will want to utilize the information at the end of the article:
    If you can't deactivate iMessage after you perform the steps above or you can't access the iPhone, please contact Apple Support.
    Thanks for coming to the Apple Support Communities!
    Cheers,
    Braden

  • When I plug my ipod in I am able to add song to it but the tab that says "on this ipod" no longer shows up so I cannot remove things from my ipod or anything like that. How do I change this weird setting?

    When I plug my ipod in I am able to add song to it but the tab that says "on this ipod" no longer shows up so I cannot remove things from my ipod or anything like that. How do I change this weird setting? On other computers this shows up fine so it is clearly a problem with itunes and not my ipod.

  • I just recalibrated my battery and now cannot remove anything from my dock. Don't know if this has anything to do with it or not. I have moved it up the screen and held it and still returns to the dock. What now?

    I do not know if this has anything to do with my problem or not. I just recalibrated my battery and now cannot remove anything from the dock. I have moved it half way up and held it and it just goes back to the dock. Will not let me even put it in the trash. I am new to the macbook so would you please help me?

    There is NO calibration on a modern macbook
    Battery calibration, battery memory, battery overcharging, battery training, …all these concepts are mostly holdovers from much older battery technology, and on older Apple portable Macbooks ranging from early nicads, NiMh and otherwise; and these practices do not apply to your lithium battery and its smart controllers.
    Current Apple portable computer batteries are pre-calibrated and are not to be calibrated
    http://support.apple.com/kb/ht1490
    There is no battery calibration with current Apple portable Macbooks with built-in batteries. Lithium batteries have essentially a 0-‘memory’, and all such calibration involve the estimations fed to the system controller on the SOC (state of charge) of the battery over long periods of time as the battery degrades. The software based battery controller knows the battery's characteristics, or SOC and adjusts itself. This is why there is both no need and purpose to periodically deeply drain your macbook battery, since it doesn’t affect the characteristics of the battery, and further still deep discharges are something you should not do on purpose to any lithium battery.

  • My email address changed and now I cannot remove it from cloud on my iphone 5s in order to back my phone up and download apps now

    my email address changed and now I cannot remove it from cloud on my iphone 5s in order to back my phone up and download apps now

    If you are trying to change the iCloud ID on yoru phone from an old ID ("email address") to your current ID, and if it is an earlier version of your current ID, go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • I cannot remove songs from iCloud - how can I do it without paying for iTune match subscription?

    I cannot remove songs from iCloud - how can I do it without paying for iTune match subscription? Different answers in this forum make it iTune match enabled. But enabling iTune match cost me $24. Help please.

    You are correct, you cannot delete songs from iTunes in the Cloud. This is where all of your purchases are permanently stored so if you want to re-download something you can. Sometimes purchases will no longer be available, if the merchant pulls them from the iTunes store, but for the most part, all of your past purchases will remain in iTunes in the Cloud.
    This has absolutely nothing to do with iTunes Match.
    What is the issue you are experiencing?
    Cheers,
    GB

  • 10g: Cannot remove package from "model" (business components)

    Using the new 9.0.5.1 JDev. I have removed all of the object in a package.Security package, because i did not want the capital letter in the package name (suspected of causing some other problems in my workspace). I cannot create a package.security package at all now. after just browsing the project defination, and looking in some other xml files, I see that the package is still defined all over the place, even without files in it.
    Why is this persisted? Shouldn't it be cleaned up when the last file is removed?
    Or at least, shouldn't I be able to remove it from my project without hacking all the XML code?

    package is an illegal name for a package in Java, I believe, so let's assume you started with "test.Security" package name.
    I filed Bug# 3574928 for the problem that exists in trying to "Move to Different Package..." if the destination package only differs from the target package by a different of case.
    The workaround in the meantime is to:
    1. Shift-select components in "test.Security" package and right-mouse "Move to Different Package...".
    2. Use a package name temporarily like "test.security2"
    3. Do "View | System Navigator" to see the System Navigator.
    4. Use System Navigator to erase the "test.Security" package by clicking on the BC4J package and right-mouse "Erase from Disk..."
    5. Close the project, and reopen it.
    6. Shift-select components in "test.security2" package and right-mouse "Move to Different Package...".
    7. Specify "test.security" as the target package.

  • Cannot remove songs from playlists in the latest iTunes version

    I am running iTunes 11.1.5.  When I select a song or songs in a playlist that I want to remove from the playlist (but keep in iTunes) and hit the Delete or Backspace key nothing happens.  What's strange is I am able to remove songs from some of my playlists but not others.  Does this behavior work differently in playlists I create myaself and playlists iTunes provides for you?  It seems I can remove songs from my own playlists but not from the ones provided by iTunes.
    Thanks.
    Jesse

    You cannot manually add or delete from smart playlists (they appear in purple in my iTunes and at the top of all the playlists).  Smart playlist content is generated by the rules controlling the playlist.  Right (control+) click on a smart playlist to see the rules.

  • Firefox downloaded with a virus cannot remove program from my computer.Have tried normal removing i.e control panel remove program I am a new user

    Firefox has a virus attached. I download without an anti virus program in place.I now cannot remove current version of mozilla 3.6.3 from my computer. I've tried =control panel= add and remove programs nothing happens. I have all kind of problems trying to open mozilla and it constantly freezes and almost ever session displays restore session box. I would like to be able to remove this version and download again with anti-virus in place. I am new to using a computer and a lot of what I do is trial an error but I have always been able to add &remove programs. Thank you
    == This happened ==
    Every time Firefox opened
    == I downloaded

    Help->Troubleshooting information
    Copy contents of the webpage
    Paste them into your reply
    Help->Troubleshooting information
    Find on this page this part of table
    Build Configuration about:buildconfig
    click "about:buildconfig" link
    copy contents of this page
    paste them into your next reply
    (separately from contents of previous page)
    If possible, give link to the web-page from which you downloaded Firefox.
    Are you opening Add&Remove programs as the same user which installed Firefox?
    --------------------------------------------

  • Cannot remove movies from ipad under normal conditions with itunes

    Have three films loaded into ipad mini but i cannot remove them. Two are in my musi/itunes/movies directory on my pc but a third is on the ipad but not on my portable. if I try to download them afresh from the itunes store they just get added again to the storage and i run out of memory. These fims seem to have been loaded in a pevious version of the ipad ios system.
    Is there any other way to get rid of them as connecting by usb only allows access to the photo library.

    ... it works. The problem was in front of the computer ...

  • I cannot remove Avast from Safari.  It is blocking a website that I need for remote access to my office.  I have dragged Avast to the trash and have restarted my computer.  It is no longer installed as an app on my Mac.  Does anyone know what to do?

    How do I remove Avast from Safari?

    "Avast" is perhaps the worst of the whole wretched lot of commercial "security" products for the Mac. Not only does it fail to protect you from any real danger, it throws false warnings, destabilizes and slows down the computer, and sometimes or always corrupts the network settings and the permissions of files in your home folder. Removing it may not repair all the damage.
    Back up all data, then remove "Avast" according to the developer's instructions. Restart.
    If you tried to remove Avast by dragging an application to the Trash, you'll have to reinstall it and then follow the instructions linked above.

  • Cannot remove music from iPad. Why?

    I need to remove music from my iPad to create space to import movies. However, via iTunes/Sync even though I uncheck the Sync Music box I find that the music remains on my iPad. What am I doing wrong?

    It should remove the music once you click on your phone in the left pane and go to the music tab at the top of the iTunes screen. I have tried this myself just now with my iPhone 4S. Once I deselected sync all music, the capacity bar at the bottom changed to show no music. If I had selected sync, all my music would have been removed from my phone.
    Since you removed the music from directly from the phone and not iTunes, once you connect to iTunes and sync, the same music will be synced back onto the phone.
    Try playing with the settings and see what you come up with. Also, try closing iTunes and restart your computer amd see if this fixes things.

  • Cannot remove PO from MR11

    Hi experts,
    I want to remove aPO from transaction MR11 (maintian GR/IR account).
    It is not possible because there is an inconsistency between the document field and the profitability segment.
    They have different company codes.
    How can I post the documents?
    Thank you.
    Kind regards,
    Linfa .
    Edited by: Belinda Verding on Apr 28, 2009 4:09 PM

    Good morning,
    Thank you for your reply.
    Where can I lock the PO? In which TAB of the PO line?
    I found OSS note 728362 MR11 incorrect clearing values for delivery costs.
    Could this OSS note also be used?
    Do you have any experience?
    Thank you.
    Kind regards,
    Linda

  • EPrint job printed fine but cannot remove it from my print que

     I used my computer @ work to print a document to eprint. It printed just fine, but I cannot remove the print job in the que in my laptop (not the computer I used @ work). Because I cannot remove it, I cannot print anything. Help

    Hi Msdelta,
    I have a couple of questions for you.  When you sent the document to the printer did you use the ePrint email address?  When you refer to que are you logging into your ePrint account and checking your ePrint history?  Are you speaking of your print que on your computer?

  • Cannot remove DVX from PC

    Hi, I need to remove Divx from my PC, including the Plus Player, Converter, and any other Divx program on my PC. Divx does not show up in the Add/Remove programs section of my control panel, nor can I find it using another program for removing software I have on my PC. I don't have room on my PC for Divx, and all it does is freeze my web browser and crash it on video sites using Divx. Please help me uninstall Divx! Thank you, T

    It is solved now. It turnes out that Windows 7 SP1 had killed some of the driver registrations. I did not have a modem device, a serial port, etc., only the cable connectivity component worked.
    Though reinstalling Ovi Suite did not help, completely removing and reinstalling all Nokia stuff did the wonder.

Maybe you are looking for