Bug 202907 - [JFace] BooleanFieldEditor has no setBooleanValue method
Summary: [JFace] BooleanFieldEditor has no setBooleanValue method
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-11 08:26 EDT by rengerve CLA
Modified: 2019-09-06 16:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rengerve CLA 2007-09-11 08:26:59 EDT
Build ID: I20070625-1500

Steps To Reproduce:
creating a preference panel with BooleanFieldEditor doesn't allow to control their checked state.


More information:

Workaround: 
1. I created a class inheriting from BooleanFieldEditor to acces some protected methods : getChangeControl() and doLoad() 
2. I used getChangeControl().setSelection but the wasSelected internal state is not maintained. 
3. Calling doLoad reset the wasSelected value.
Comment 1 Susan McCourt CLA 2007-09-12 11:46:07 EDT
FieldEditors generally do not allow programmatic setting of their values.  They obtain their value from the preference store supplied when they are created, and set the preference value if the user changes it.  Some field editors provide convenience methods for getting the current value, but none provide programmatic changing of the value.

To consider deviating from this design, I would need to better understand what you are trying to accomplish.  
Comment 2 rengerve CLA 2007-09-13 04:16:09 EDT
I have 3 preferences :
1 generate info
2 check info
3 validate info

When 1 is unchecked 2 & 3 have to be unchecked and disabled
when checking 1, 2 has to be enabled
When 2 is checked 3 has to be enabled.

The problem is that using getChangeControl().setValue(true) on 2 will not reset its wasSelected value. Then when clicking on button 2 no selection event is triggered because the wasSelected didn't change.

I understand that using protected method like getChangeControl() and doLoad() is clearly overpassing the design you created but I still need to workaround the limitation of non being able to programtically interact with the FieldEditor.
Comment 3 Susan McCourt CLA 2009-07-09 17:37:33 EDT
as per 2009 triage guidelines
Comment 4 Eclipse Webmaster CLA 2019-09-06 16:04:54 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.