Home » Eclipse Projects » Eclipse Platform » [Howto] use RadioGroupFieldEditor?
[Howto] use RadioGroupFieldEditor? [message #147231] |
Tue, 21 October 2003 13:48 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Paul E. Keyser![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=rolarenfan%40earthlink.net) Messages: 878 Registered: July 2009 |
Senior Member |
|
|
R2.1; WinXP
I've successfully used the Boolean- and ComboBox-FieldEditors, but the
RadioGroupFieldEditor is different in some way. What I need to know how
to do is to "access" the value. For example, with a BooleanFieldEditor,
assuming only that THE_TAG had been suitably defined as a public static
String, and used like this:
addField(new BooleanFieldEditor(THE_TAG, "label",
getFieldEditorParent()));
in our perference-page, then to access the value I would write:
boolean value =
OUR_Plugin.getDefault().getPreferenceStore().getBoolean(THE_ TAG);
Now, I can define the tag and add the Field just fine for a
RadioGroupFieldEditor, but what do I use to access the value? I tried
using the tag (i.e., the first String parameter to the constructor of
RadioGroupFieldEditor) and got always a null String or a false boolean;
I tried using the "value" (i.e., if the fourth parameter to the
constructor of RadioGroupFieldEditor was named "foo", I used foo[i][1]),
but also always got a null String or a false boolean. The javadocs for
RadioGroupFieldEditor don't even address the question that I can find,
and the few examples in the R2.1 code-base don't help, because there is
no way to find the places where the value is accessed, because the tag
and all other Strings have been inlined, so the Search won't find them.
Any clues?
Thanks,
Paul K
|
|
|
Re: [Howto] use RadioGroupFieldEditor? [message #147279 is a reply to message #147231] |
Tue, 21 October 2003 14:55 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Darin Swanson![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=Darin_Swanson%40us.ibm.com) Messages: 2386 Registered: July 2009 |
Senior Member |
|
|
We use it in debug land by querying the preference store for the name that
was used as the first argument when you created the RadioGroupFieldEditor.
prefStore.getString(THE_TAG) to use your example. You then compare it to one
of the values that you set in the constructor.
See DebugPreferencePage.createSaveBeforeLaunchEditors and
DebugUIPlugin.preLaunchSave() for the use of
IDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH_RADI O
I think this existed in 2.1....it does in 3.0
HTH
Darins
"Paul T. Keyser" <rolarenfan@earthlink.net> wrote in message
news:3F953944.7B5E022D@earthlink.net...
> R2.1; WinXP
>
> I've successfully used the Boolean- and ComboBox-FieldEditors, but the
> RadioGroupFieldEditor is different in some way. What I need to know how
> to do is to "access" the value. For example, with a BooleanFieldEditor,
> assuming only that THE_TAG had been suitably defined as a public static
> String, and used like this:
>
> addField(new BooleanFieldEditor(THE_TAG, "label",
> getFieldEditorParent()));
>
> in our perference-page, then to access the value I would write:
>
> boolean value =
> OUR_Plugin.getDefault().getPreferenceStore().getBoolean(THE_ TAG);
>
> Now, I can define the tag and add the Field just fine for a
> RadioGroupFieldEditor, but what do I use to access the value? I tried
> using the tag (i.e., the first String parameter to the constructor of
> RadioGroupFieldEditor) and got always a null String or a false boolean;
> I tried using the "value" (i.e., if the fourth parameter to the
> constructor of RadioGroupFieldEditor was named "foo", I used foo[i][1]),
> but also always got a null String or a false boolean. The javadocs for
> RadioGroupFieldEditor don't even address the question that I can find,
> and the few examples in the R2.1 code-base don't help, because there is
> no way to find the places where the value is accessed, because the tag
> and all other Strings have been inlined, so the Search won't find them.
>
> Any clues?
>
> Thanks,
> Paul K
>
>
|
|
|
Re: [Howto] use RadioGroupFieldEditor? [message #147399 is a reply to message #147279] |
Tue, 21 October 2003 18:42 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Paul E. Keyser![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=rolarenfan%40earthlink.net) Messages: 878 Registered: July 2009 |
Senior Member |
|
|
OK, that worked -- I guess I was failing to set the initial "default" values of
the preference, hence getting null strings.
Thanks,
Paul
Darin Swanson wrote:
> We use it in debug land by querying the preference store for the name that
> was used as the first argument when you created the RadioGroupFieldEditor.
> prefStore.getString(THE_TAG) to use your example. You then compare it to one
> of the values that you set in the constructor.
>
> See DebugPreferencePage.createSaveBeforeLaunchEditors and
> DebugUIPlugin.preLaunchSave() for the use of
> IDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH_RADI O
>
> I think this existed in 2.1....it does in 3.0
>
> HTH
> Darins
>
> "Paul T. Keyser" <rolarenfan@earthlink.net> wrote in message
> news:3F953944.7B5E022D@earthlink.net...
> > R2.1; WinXP
> >
> > I've successfully used the Boolean- and ComboBox-FieldEditors, but the
> > RadioGroupFieldEditor is different in some way. What I need to know how
> > to do is to "access" the value. For example, with a BooleanFieldEditor,
> > assuming only that THE_TAG had been suitably defined as a public static
> > String, and used like this:
> >
> > addField(new BooleanFieldEditor(THE_TAG, "label",
> > getFieldEditorParent()));
> >
> > in our perference-page, then to access the value I would write:
> >
> > boolean value =
> > OUR_Plugin.getDefault().getPreferenceStore().getBoolean(THE_ TAG);
> >
> > Now, I can define the tag and add the Field just fine for a
> > RadioGroupFieldEditor, but what do I use to access the value? I tried
> > using the tag (i.e., the first String parameter to the constructor of
> > RadioGroupFieldEditor) and got always a null String or a false boolean;
> > I tried using the "value" (i.e., if the fourth parameter to the
> > constructor of RadioGroupFieldEditor was named "foo", I used foo[i][1]),
> > but also always got a null String or a false boolean. The javadocs for
> > RadioGroupFieldEditor don't even address the question that I can find,
> > and the few examples in the R2.1 code-base don't help, because there is
> > no way to find the places where the value is accessed, because the tag
> > and all other Strings have been inlined, so the Search won't find them.
> >
> > Any clues?
> >
> > Thanks,
> > Paul K
> >
> >
|
|
|
Goto Forum:
Current Time: Sun Sep 01 05:13:54 GMT 2024
Powered by FUDForum. Page generated in 0.03895 seconds
|