<Swing Dev> [9] Review request for 8158566 Provide a Swing property to not close toggle menu items on mouse click

Phil Race philip.race at oracle.com
Mon Jun 20 19:55:45 UTC 2016


   59  * Some times it is required to select several check box menu items from a button
   60  * group. In this case it is useful that clicking on one check box menu item
   61  * does not close the menu. Such behavior can be controlled by the Look and Feel
   62  * property named {@code "CheckBoxMenuItem.closeOnMouseClick"}.

Just to make things clear, insert here : "The default value is {@true}."

Setting
   63  * the property to {@code false} prevents the menu from closing when it is clicked
   64  * by the mouse.
   65  * Note: some {@code L&F}s may ignore this property.

It appears to me that all L&Fs that inherit from Basic should inherit this behaviour.
Can we safely say something like :
"All built-in L&Fs and all L&Fs that subclass the BasicLookAndFeel will inherit this behaviour".

Otherwise its untestable.

-phil.

On 06/20/2016 10:59 AM, Alexandr Scherbatiy wrote:
>
> Hello,
>
> Could you review the updated fix:
>   http://cr.openjdk.java.net/~alexsch/8158566/webrev.01/
>
> The documentation is added to the JCheckBoxMenuItem and 
> JRadioButtonMenuItem classes.
>
> Thanks,
> Alexandr.
>
> On 6/19/2016 9:05 PM, Philip Race wrote:
>> So how does one know of the existence of this property ?
>> There seems to be a documentation/specification element missing here.
>>
>> Perhaps if you query the supported properties on the component
>> it is returned, but you still need documentation to explain how
>> it is used/interpreted.
>>
>> If it is not documented .. it can not be supported API, which is what we
>> need here.
>>
>> If the answer is that none of the others are documented,
>> then that is a problem too .. no matter how long standing.
>>
>> -phil.
>>
>>
>> On 6/14/16, 12:49 PM, Alexandr Scherbatiy wrote:
>>>
>>> Hello,
>>>
>>> Could you review the fix:
>>>   bug: https://bugs.openjdk.java.net/browse/JDK-8158566
>>>   webrev: http://cr.openjdk.java.net/~alexsch/8158566/webrev.00
>>>
>>>   The proposed "RadioButtonMenuItem.closeOnMouseClick" and 
>>> "CheckBoxMenuItem.closeOnMouseClick" properties allows to control 
>>> JRadioButtonMenuItem and JCheckBoxMenuItem closing on mouse click.
>>>
>>>  Thanks,
>>>  Alexandr.
>>>
>>>
>




More information about the swing-dev mailing list