You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Anton Ivanov (JIRA)" <ji...@apache.org> on 2006/12/12 15:26:31 UTC

[jira] Created: (HARMONY-2647) [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name

[classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name
-----------------------------------------------------------------------------------------------

                 Key: HARMONY-2647
                 URL: http://issues.apache.org/jira/browse/HARMONY-2647
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Anton Ivanov


See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4177283
Since javax.swing.text.JTextComponent has methods getFocusAccelerator(), setFocusAccelerator(), the corresponding property name should be "focusAccelerator".

The test to reproduce the problem:

----------------------------------------------------------------------------------
import java.beans.*;
import javax.swing.text.*;
import javax.swing.event.*;

public class FocusAcceleratorKeyTest {

    JTextComponent jtc;
    SimplePropertyChangeListener pChListener;

    class SimplePropertyChangeListener implements PropertyChangeListener {
        PropertyChangeEvent event;

        public void propertyChange(final PropertyChangeEvent e) {
            if (e.getPropertyName() != "ancestor") {
                event = e;
            }
        }
    }

    public static void main(String argv[]) {
        new FocusAcceleratorKeyTest().test();            
    }


    public void test() {

       pChListener = new SimplePropertyChangeListener();
       jtc = new JTextArea();
       jtc.addPropertyChangeListener(pChListener);

       jtc.setFocusAccelerator('b');
       System.out.println(pChListener.event.getPropertyName());
       System.out.println(JTextComponent.FOCUS_ACCELERATOR_KEY);
    }
}
----------------------------------------------------------------------------------

RI returns the right name for the property: "focusAccelerator" while Harmony returns "focusAcceleratorKey".
Specification says that JTextComponent.FOCUS_ACCELERATOR_KEY is the "bound property name for the focus accelerator"
it is defined as "focusAcceleratorKey" in specification. It seems to be a misprint.
JTextComponent.FOCUS_ACCELERATOR_KEY should be "focusAccelerator" and PropertyChangeEvent.getPropertyName should return a right property name.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HARMONY-2647) [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name

Posted by "Alexei Zakharov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexei Zakharov updated HARMONY-2647:
-------------------------------------

    Priority: Minor  (was: Major)

> [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2647
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2647
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Anton Ivanov
>            Priority: Minor
>         Attachments: Text.java
>
>
> See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4177283
> Since javax.swing.text.JTextComponent has methods getFocusAccelerator(), setFocusAccelerator(), the corresponding property name should be "focusAccelerator".
> The test to reproduce the problem:
> ----------------------------------------------------------------------------------
> import java.beans.*;
> import javax.swing.text.*;
> import javax.swing.event.*;
> public class FocusAcceleratorKeyTest {
>     JTextComponent jtc;
>     SimplePropertyChangeListener pChListener;
>     class SimplePropertyChangeListener implements PropertyChangeListener {
>         PropertyChangeEvent event;
>         public void propertyChange(final PropertyChangeEvent e) {
>             if (e.getPropertyName() != "ancestor") {
>                 event = e;
>             }
>         }
>     }
>     public static void main(String argv[]) {
>         new FocusAcceleratorKeyTest().test();            
>     }
>     public void test() {
>        pChListener = new SimplePropertyChangeListener();
>        jtc = new JTextArea();
>        jtc.addPropertyChangeListener(pChListener);
>        jtc.setFocusAccelerator('b');
>        System.out.println(pChListener.event.getPropertyName());
>        System.out.println(JTextComponent.FOCUS_ACCELERATOR_KEY);
>     }
> }
> ----------------------------------------------------------------------------------
> RI returns the right name for the property: "focusAccelerator" while Harmony returns "focusAcceleratorKey".
> Specification says that JTextComponent.FOCUS_ACCELERATOR_KEY is the "bound property name for the focus accelerator"
> it is defined as "focusAcceleratorKey" in specification. It seems to be a misprint.
> JTextComponent.FOCUS_ACCELERATOR_KEY should be "focusAccelerator" and PropertyChangeEvent.getPropertyName should return a right property name.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-2647) [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name

Posted by "Evgeniya Maenkova (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evgeniya Maenkova updated HARMONY-2647:
---------------------------------------

    Attachment: Text.java

test

> [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2647
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2647
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Anton Ivanov
>         Attachments: Text.java
>
>
> See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4177283
> Since javax.swing.text.JTextComponent has methods getFocusAccelerator(), setFocusAccelerator(), the corresponding property name should be "focusAccelerator".
> The test to reproduce the problem:
> ----------------------------------------------------------------------------------
> import java.beans.*;
> import javax.swing.text.*;
> import javax.swing.event.*;
> public class FocusAcceleratorKeyTest {
>     JTextComponent jtc;
>     SimplePropertyChangeListener pChListener;
>     class SimplePropertyChangeListener implements PropertyChangeListener {
>         PropertyChangeEvent event;
>         public void propertyChange(final PropertyChangeEvent e) {
>             if (e.getPropertyName() != "ancestor") {
>                 event = e;
>             }
>         }
>     }
>     public static void main(String argv[]) {
>         new FocusAcceleratorKeyTest().test();            
>     }
>     public void test() {
>        pChListener = new SimplePropertyChangeListener();
>        jtc = new JTextArea();
>        jtc.addPropertyChangeListener(pChListener);
>        jtc.setFocusAccelerator('b');
>        System.out.println(pChListener.event.getPropertyName());
>        System.out.println(JTextComponent.FOCUS_ACCELERATOR_KEY);
>     }
> }
> ----------------------------------------------------------------------------------
> RI returns the right name for the property: "focusAccelerator" while Harmony returns "focusAcceleratorKey".
> Specification says that JTextComponent.FOCUS_ACCELERATOR_KEY is the "bound property name for the focus accelerator"
> it is defined as "focusAcceleratorKey" in specification. It seems to be a misprint.
> JTextComponent.FOCUS_ACCELERATOR_KEY should be "focusAccelerator" and PropertyChangeEvent.getPropertyName should return a right property name.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HARMONY-2647) [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463590 ] 

Vasily Zakharov commented on HARMONY-2647:
------------------------------------------

I'll look into this issue.


> [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2647
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2647
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Anton Ivanov
>
> See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4177283
> Since javax.swing.text.JTextComponent has methods getFocusAccelerator(), setFocusAccelerator(), the corresponding property name should be "focusAccelerator".
> The test to reproduce the problem:
> ----------------------------------------------------------------------------------
> import java.beans.*;
> import javax.swing.text.*;
> import javax.swing.event.*;
> public class FocusAcceleratorKeyTest {
>     JTextComponent jtc;
>     SimplePropertyChangeListener pChListener;
>     class SimplePropertyChangeListener implements PropertyChangeListener {
>         PropertyChangeEvent event;
>         public void propertyChange(final PropertyChangeEvent e) {
>             if (e.getPropertyName() != "ancestor") {
>                 event = e;
>             }
>         }
>     }
>     public static void main(String argv[]) {
>         new FocusAcceleratorKeyTest().test();            
>     }
>     public void test() {
>        pChListener = new SimplePropertyChangeListener();
>        jtc = new JTextArea();
>        jtc.addPropertyChangeListener(pChListener);
>        jtc.setFocusAccelerator('b');
>        System.out.println(pChListener.event.getPropertyName());
>        System.out.println(JTextComponent.FOCUS_ACCELERATOR_KEY);
>     }
> }
> ----------------------------------------------------------------------------------
> RI returns the right name for the property: "focusAccelerator" while Harmony returns "focusAcceleratorKey".
> Specification says that JTextComponent.FOCUS_ACCELERATOR_KEY is the "bound property name for the focus accelerator"
> it is defined as "focusAcceleratorKey" in specification. It seems to be a misprint.
> JTextComponent.FOCUS_ACCELERATOR_KEY should be "focusAccelerator" and PropertyChangeEvent.getPropertyName should return a right property name.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2647) [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name

Posted by "Vasily Zakharov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12464930 ] 

Vasily Zakharov commented on HARMONY-2647:
------------------------------------------

I'm not sure how this issue is to be resolved.

RI holds incorrect value in JTextComponent.FOCUS_ACCELERATOR_KEY field and anyway returns correct value from PropertyChangeEvent.getPropertyName().

Probably it's a kind of a tweak in RI we must follow not, and probably the situation is not as simple as it seems.

I'm giving this up hoping someone confident in Swing would look into it. 


> [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2647
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2647
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Anton Ivanov
>
> See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4177283
> Since javax.swing.text.JTextComponent has methods getFocusAccelerator(), setFocusAccelerator(), the corresponding property name should be "focusAccelerator".
> The test to reproduce the problem:
> ----------------------------------------------------------------------------------
> import java.beans.*;
> import javax.swing.text.*;
> import javax.swing.event.*;
> public class FocusAcceleratorKeyTest {
>     JTextComponent jtc;
>     SimplePropertyChangeListener pChListener;
>     class SimplePropertyChangeListener implements PropertyChangeListener {
>         PropertyChangeEvent event;
>         public void propertyChange(final PropertyChangeEvent e) {
>             if (e.getPropertyName() != "ancestor") {
>                 event = e;
>             }
>         }
>     }
>     public static void main(String argv[]) {
>         new FocusAcceleratorKeyTest().test();            
>     }
>     public void test() {
>        pChListener = new SimplePropertyChangeListener();
>        jtc = new JTextArea();
>        jtc.addPropertyChangeListener(pChListener);
>        jtc.setFocusAccelerator('b');
>        System.out.println(pChListener.event.getPropertyName());
>        System.out.println(JTextComponent.FOCUS_ACCELERATOR_KEY);
>     }
> }
> ----------------------------------------------------------------------------------
> RI returns the right name for the property: "focusAccelerator" while Harmony returns "focusAcceleratorKey".
> Specification says that JTextComponent.FOCUS_ACCELERATOR_KEY is the "bound property name for the focus accelerator"
> it is defined as "focusAcceleratorKey" in specification. It seems to be a misprint.
> JTextComponent.FOCUS_ACCELERATOR_KEY should be "focusAccelerator" and PropertyChangeEvent.getPropertyName should return a right property name.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2647) [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name

Posted by "Evgeniya Maenkova (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12471445 ] 

Evgeniya Maenkova commented on HARMONY-2647:
--------------------------------------------

I believe, it appears as some time ago both field name and property change event name were the same - "focusAcceleraterKey". See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4341002, http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4177283.

Then property name was changed and field name was left.  Looks like this mess comes from there.

It would be logically to have field name as "focusAccelerator", as it's declared as "bound" property. 
---
My test shows there are 2 property change events with both names: "focusAcceleratorKey" and "focusAccelerator".
It confirms all mentioned above, and I believe it was done for compatibility with prev versions.

And my view is: we could fire 2 events also.

The test is: [to be attached]

import java.beans.PropertyChangeListener;

import javax.swing.JTextArea;
import javax.swing.text.JTextComponent;

public class Text {
	public static void main(String[] args) {
		System.out.println(JTextComponent.FOCUS_ACCELERATOR_KEY);
		JTextArea area = new JTextArea();
		area.addPropertyChangeListener(new PropertyChangeListener() {
			public void propertyChange(java.beans.PropertyChangeEvent arg0) {
			     System.out.println("name = " + arg0.getPropertyName() + " " 
			    		 + arg0.getNewValue()
			    		 + " "
			    		 + arg0.getOldValue()
			    		 );	
			}
		});
		System.out.println("_________");
		area.setFocusAccelerator('7');
		System.out.println("_________");
		area.setFocusAccelerator('8');
		System.out.println("_________");
		area.setFocusAccelerator('9');
		System.out.println("_________");
		area.setFocusAccelerator('a');
		System.out.println("_________");
		area.setFocusAccelerator('b'); 	
		System.out.println("_________");
	}

}


RI output:

focusAcceleratorKey

_________

name = focusAcceleratorKey 7 _

name = _WhenInFocusedWindow {} null

name = focusAccelerator 7 _

_________

name = focusAcceleratorKey 8 7

name = _WhenInFocusedWindow null {}

name = _WhenInFocusedWindow {} null

name = focusAccelerator 8 7

_________

name = focusAcceleratorKey 9 8

name = _WhenInFocusedWindow null {}

name = _WhenInFocusedWindow {} null

name = focusAccelerator 9 8

_________

name = focusAcceleratorKey A 9

name = _WhenInFocusedWindow null {}

name = _WhenInFocusedWindow {} null

name = focusAccelerator A 9

_________

name = focusAcceleratorKey B A

name = _WhenInFocusedWindow null {}

name = _WhenInFocusedWindow {} null

name = focusAccelerator B A

_________

 










> [classlib][swing] javax.swing.text.JTextComponent focusAcceleratorKey property has invalid name
> -----------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-2647
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2647
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Anton Ivanov
>
> See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4177283
> Since javax.swing.text.JTextComponent has methods getFocusAccelerator(), setFocusAccelerator(), the corresponding property name should be "focusAccelerator".
> The test to reproduce the problem:
> ----------------------------------------------------------------------------------
> import java.beans.*;
> import javax.swing.text.*;
> import javax.swing.event.*;
> public class FocusAcceleratorKeyTest {
>     JTextComponent jtc;
>     SimplePropertyChangeListener pChListener;
>     class SimplePropertyChangeListener implements PropertyChangeListener {
>         PropertyChangeEvent event;
>         public void propertyChange(final PropertyChangeEvent e) {
>             if (e.getPropertyName() != "ancestor") {
>                 event = e;
>             }
>         }
>     }
>     public static void main(String argv[]) {
>         new FocusAcceleratorKeyTest().test();            
>     }
>     public void test() {
>        pChListener = new SimplePropertyChangeListener();
>        jtc = new JTextArea();
>        jtc.addPropertyChangeListener(pChListener);
>        jtc.setFocusAccelerator('b');
>        System.out.println(pChListener.event.getPropertyName());
>        System.out.println(JTextComponent.FOCUS_ACCELERATOR_KEY);
>     }
> }
> ----------------------------------------------------------------------------------
> RI returns the right name for the property: "focusAccelerator" while Harmony returns "focusAcceleratorKey".
> Specification says that JTextComponent.FOCUS_ACCELERATOR_KEY is the "bound property name for the focus accelerator"
> it is defined as "focusAcceleratorKey" in specification. It seems to be a misprint.
> JTextComponent.FOCUS_ACCELERATOR_KEY should be "focusAccelerator" and PropertyChangeEvent.getPropertyName should return a right property name.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.