[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] FieldEditor does not write default-value

in a prefgerences-page i have two FieldEditors. to ease the use i display default-values, so the suer has not to type in any values if he's happy with default ones.
but the default values are not stored to the prefs -- thus any attempt to use those values causes an error.
if i fill in arbitrary values, different from the default, it's stored -- but thus the ability to present default values seems meaningless to me.
what do i wrong, how do i force the FieldEditors to save even the unchanged default?



public class LocalDBPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {


    IPreferenceStore ips;

public LocalDBPreferencePage() {
super(GRID);
setPreferenceStore(ips=MyPlugin.getDefault().getPreferenceStore());
setDescription("Preference page for the local Derby-DB");
ips.setDefault("derbydbpath", Platform.getLocation().toOSString());
ips.setDefault("derbydbname", "NJVDB");
}

public void createFieldEditors() {
Composite fep=getFieldEditorParent();


DirectoryFieldEditor dfe=new DirectoryFieldEditor(PreferenceConstants.P_PATH, "&Speicherort der DB:", fep);
dfe.setPreferenceName("derbydbpath");
addField(dfe);


StringFieldEditor sfeDBN=new StringFieldEditor(PreferenceConstants.P_STRING, "Datenbankname:", fep);
sfeDBN.setPreferenceName("derbydbname");
addField(sfeDBN);
}


	public void init(IWorkbench workbench) {}
	
}