/** Helper implementation of WizardDescription.Panel for TemplateWizard.Panel2. * Provides the wizard panel with the opportunity to update the * settings with its current customized state. * Rather than updating its settings with every change in the GUI, it should collect them, * and then only save them when requested to by this method. * Also, the original settings passed to {@link #readSettings} should not be modified (mutated); * rather, the object passed in here should be mutated according to the collected changes, * in case it is a copy. * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>. * <p>The settings object is originally supplied to {@link WizardDescriptor#WizardDescriptor(WizardDescriptor.Iterator,Object)}. * In the case of a <code>TemplateWizard.Iterator</code> panel, the object is * in fact the <code>TemplateWizard</code>. * @param settings the object representing wizard panel state * */ void implStoreSettings(Object settings) { TemplateWizard wizard = (TemplateWizard)settings; wizard.setTargetFolder (locationFolder); String name = newObjectName.getText (); if (name.equals (defaultNewObjectName ())) { name = null; } wizard.setTargetName (name); }
if (wizard instanceof DefaultTemplateWizard) { if (targetFolder != null && targetFolder.isValid()) wizard.setTargetFolder(targetFolder); if (selectedTemplate != null && selectedTemplate.isValid()) wizard.setTemplate(selectedTemplate);