Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Confusing IPrefrenceStore and PreferenceService
Confusing IPrefrenceStore and PreferenceService [message #503864] Wed, 16 December 2009 07:23
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hi all,

i've used IPreferenceStore sometimes in the past, to store the values of
my field editor's values. Now, i was confronted with PrefereneService,
which seems to be the same concept, but it doesn't work with the old
preference store, i guess.

Currently, i'm storing the values of the field editors in this way:

###############
public MBTStructuralCoverageCriteriaPreferencePage() {
super(GRID);
setPreferenceStore(Activator.getDefault().getPreferenceStore ());
setDescription("A demonstration of a preference page implementation");
}

....

addField(new RadioGroupFieldEditor(PreferenceConstants.COVERAGE_CRITERIA,
"&Coverage:", 1,
new String[][] {
{"&state coverage", MBTToolConstants.CONDITION_STATE_COVERAGE+""},
{"rea&ched state", MBTToolConstants.CONDITION_REACHED_STATE+"" },
{"&edge coverage", MBTToolConstants.CONDITION_EDGE_COVERAGE+"" },
{"re&ached edge", MBTToolConstants.CONDITION_REACHED_REQUIREMENT+"" },
{"test &length", MBTToolConstants.CONDITION_TEST_LENGTH+"" },
/*{"&requirements coverage",
MBTToolConstants.CONDITION_REQUIREMENT_COVERAGE+"" },*/
/*{"r&eached requirement",
MBTToolConstants.CONDITION_REACHED_REQUIREMENT+"" },*/
{"&no particular condition", MBTToolConstants.CONDITION_NEVER+"" }
}, getFieldEditorParent()));
....
################

May i have to save the store manually by overwriting performOK() or will
the store be saved automatically for persistence?

In my application code, i try to access the preferences like this:

###########
final IPreferencesService service = Platform.getPreferencesService();
final String alternativeConditionDetail = service.getString(toolQN,
PreferenceConstants.DEFAULT_TEST_LENGTH_VALUE, 15+"", null);
###########

But this doesn't work... i'm really confused, because i think, i've
misunderstood how these things corelate with each other. Can anyone help
me, please?

Thanks Timothy
Previous Topic:Login plugin
Next Topic:MS Access like application as RCP application?
Goto Forum:
  


Current Time: Tue Mar 19 05:01:36 GMT 2024

Powered by FUDForum. Page generated in 0.22853 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top