/** 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); }
/** 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 (copy) passed in here should be mutated according to the collected changes. * This method can be called multiple times on one instance of <code>WizardDescriptor.Panel</code>. * @param settings the object representing a settings of the wizard */ public void storeSettings(Object settings) { String name = getPanelUI ().getNewObjectName (); if (name.equals (NewObjectPanel.defaultNewObjectName ())) { name = null; } if (wizard != null) { wizard.setTargetName (name); wizard = null; } }
private void doShowWizard(DataObject template, Node node) { targetFolder = null; TemplateWizard wizard = getWizard (node); try { wizard.setTargetName (null); Set created = wizard.instantiate (template, targetFolder); if (created != null && wizard instanceof DefaultTemplateWizard) { // put the item in the recent list selectedTemplate = wizard.getTemplate(); if (selectedTemplate != null) { // bugfix #36604; notify that the list recent used templates changed recentChanged = addRecent (selectedTemplate); } } } catch (IOException e) { ErrorManager em = ErrorManager.getDefault(); em.annotate(e, NbBundle.getMessage(DataObject.class, "EXC_TemplateFailed")); em.notify(e); } }
String name = prefix + pageIndex; if ((jspDir.getFileObject(name + "." + ext) == null) && ((javaDir == null) || (javaDir.getFileObject(name + ".java") == null))) { // NOI18N wizard.setTargetName(name); return; String name = header + beanIndex; if (beanDir.getFileObject(name + ".java") == null) { // NOI18N wizard.setTargetName(name); return;
wizard.setTargetName (null); wizard.instantiate (obj, targetFolder); } catch (IOException e) {
try { wizard.setTargetName(null);