getting a ComboFieldEditor's value from PreferencesStore [message #37754] |
Tue, 16 December 2008 07:06 |
Eclipse User |
|
|
|
Hello everyone,
I'm not sure if this is the right place to ask, however the other news
groups seem to be even less likely the right places. ;-)
Does anyone know, how I can access the value of a ComboFieldEditor's
selected entry name?
In my MyPreferencePage class I add the ComboFieldEditor in the
createFieldEditors() method:
...
String[][] comboValues = {{"Name A", "org.example.ConnectorA"}};
// P_CONNECTOR = "connector"
addField(new ComboFieldEditor(MyPreferenceConstants.P_CONNECTOR,
"Connector",
comboValues, getFieldEditorParent()));
...
Setting the connector in the combo box to "Name A" this String gets stored
in the PreferenceStore, but not "org.example.ConnectorA" as I'd expect.
In another class of my plug-in I need to get the value of the name-value
pair I handed into the constructor of the ComboFieldEditor:
...
String value = Activator.getDefault().getPreferenceStore().getString(
MyPreferenceConstants.P_CONNECTOR);
...
However, this call returns the name "Name A" of the name-value pair.
Any ideas how it can be achieved that the value of the name-value pair is
stored in the PreferenceStore?
Thanks for reading and helping!
|
|
|
Powered by
FUDForum. Page generated in 0.04573 seconds