Iron
Iron

Reputation: 477

Save WizardPage Settings with Java

I created a Wizard with a wizardpage for exporting Files in a Folder. How can I save the last selected folder in my wizard? So if the user opens the wizard again, the options which he selected the last time should be written in there.

Upvotes: 0

Views: 130

Answers (1)

Alex K.
Alex K.

Reputation: 3304

You could try following:

 1. Retrieve DialogSettings object.
 2. Find your section. If it is null, create it.
 3. Use it to store/load related information.

IDialogSettings settings = WorkbenchPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection("your_section_name");
if (section == null) {
   section = settings.addNewSection("your_section_name");
} 
String lastSelectedFolder = section.get("your_last_selected_folder_key");

Upvotes: 1

Related Questions