org.openide.WizardDescriptor Java Examples
The following examples show how to use
org.openide.WizardDescriptor.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BeansXmlIterator.java From netbeans with Apache License 2.0 | 6 votes |
public static String[] createSteps(String[] before, WizardDescriptor.Panel[] panels) { //assert panels != null; // hack to use the steps set before this panel processed int diff = 0; if (before == null) { before = new String[0]; } else if (before.length > 0) { diff = ("...".equals (before[before.length - 1])) ? 1 : 0; // NOI18N } String[] res = new String[ (before.length - diff) + panels.length]; for (int i = 0; i < res.length; i++) { if (i < (before.length - diff)) { res[i] = before[i]; } else { res[i] = panels[i - before.length + diff].getComponent ().getName (); } } return res; }
Example #2
Source File: GroovyJavaDemoPanelVisual.java From netbeans with Apache License 2.0 | 6 votes |
void read(WizardDescriptor settings) { File projectLocation = (File) settings.getProperty("projdir"); if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory()) { projectLocation = ProjectChooser.getProjectsFolder(); } else { projectLocation = projectLocation.getParentFile(); } this.projectLocationTextField.setText(projectLocation.getAbsolutePath()); String projectName = (String) settings.getProperty("name"); if (projectName == null) { projectName = "GroovyJavaDemo"; } this.projectNameTextField.setText(projectName); this.projectNameTextField.selectAll(); }
Example #3
Source File: PanelProjectLocationExtSrc.java From netbeans with Apache License 2.0 | 6 votes |
@Override boolean valid (WizardDescriptor settings) { String result = checkValidity ( this.projectName.getText(), this.projectLocation.getText(), this.buildScriptName.getText(), this.calculatePF); if (result == null) { wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, ""); //NOI18N return true; } else { wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, result); return false; } }
Example #4
Source File: CustomizerFrameworks.java From netbeans with Apache License 2.0 | 6 votes |
@Override public void stateChanged(ChangeEvent e) { controller.setErrorMessage(null); if (extender.isValid()) { if (!category.isValid()) { category.setValid(true); category.setErrorMessage(null); String message = (String) controller.getProperties().getProperty(WizardDescriptor.PROP_INFO_MESSAGE); if (message != null) { category.setErrorMessage(message); } } } else { category.setValid(false); category.setErrorMessage(controller.getErrorMessage()); } }
Example #5
Source File: InitializrProjectWizardIterator.java From nb-springboot with Apache License 2.0 | 6 votes |
@Override public void uninitialize(WizardDescriptor wiz) { this.wiz.putProperty(WIZ_NAME, null); this.wiz.putProperty(WIZ_GROUP, null); this.wiz.putProperty(WIZ_ARTIFACT, null); this.wiz.putProperty(WIZ_DESCRIPTION, null); this.wiz.putProperty(WIZ_PACKAGING, null); this.wiz.putProperty(WIZ_PACKAGE, null); this.wiz.putProperty(WIZ_JAVA_VERSION, null); this.wiz.putProperty(WIZ_LANGUAGE, null); this.wiz.putProperty(WIZ_DEPENDENCIES, null); this.wiz.putProperty(WIZ_PROJ_LOCATION, null); this.wiz.putProperty(WIZ_USE_SB_MVN_PLUGIN, null); this.wiz.putProperty(WIZ_REMOVE_MVN_WRAPPER, null); panels = null; }
Example #6
Source File: SimpleTestCaseWizardIterator.java From netbeans with Apache License 2.0 | 6 votes |
/** * Returns a panel for choosing name and target location of the test * class. If the panel already exists, returns the existing panel, * otherwise creates a new panel. * * @return existing panel or a newly created panel if it did not exist */ private WizardDescriptor.Panel<WizardDescriptor> getClassChooserPanel() { final Project project = Templates.getProject(wizard); if (classChooserPanel == null || project != lastSelectedProject) { SourceGroupModifier.createSourceGroup(project, JavaProjectConstants.SOURCES_TYPE_JAVA, JavaProjectConstants.SOURCES_HINT_TEST); final JUnitUtils utils = new JUnitUtils(project); if (utils.getSourcesToTestsMap(true).isEmpty()) { classChooserPanel = new StepProblemMessage( project, NbBundle.getMessage(EmptyTestCaseWizardIterator.class, "MSG_NoTestSourceGroup")); //NOI18N } else { if (classChooserPanel == null) { classChooserPanel = new SimpleTestStepLocation(); } ((SimpleTestStepLocation) classChooserPanel).setUp(utils); } } lastSelectedProject = project; return classChooserPanel; }
Example #7
Source File: ProjectImportLocationPanel.java From netbeans with Apache License 2.0 | 6 votes |
void read(WizardDescriptor settings) { wizardDescriptor = settings; File projectLocation = (File) settings.getProperty ("projdir"); //NOI18N if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory ()) projectLocation = ProjectChooser.getProjectsFolder(); else projectLocation = projectLocation.getParentFile(); String projectName = (String) settings.getProperty ("name"); //NOI18N if (projectName == null && settings.getProperty ("projdir") != null) { int baseCount = 1; while ((projectName=validFreeProjectName(projectLocation, nameFormatter, baseCount))==null) { baseCount++; } } this.projectNameTextField.setText (projectName == null ? "" : projectName); this.projectNameTextField.selectAll(); }
Example #8
Source File: SingletonSetupPanelVisual.java From netbeans with Apache License 2.0 | 6 votes |
public void store(WizardDescriptor settings) { settings.putProperty(WizardProperties.RESOURCE_PACKAGE, getPackage()); settings.putProperty(WizardProperties.RESOURCE_CLASS, classTextField.getText()); settings.putProperty(WizardProperties.RESOURCE_URI, uriTextField.getText()); settings.putProperty(WizardProperties.MIME_TYPES, new MimeType[]{(MimeType) medaTypeComboBox.getSelectedItem()}); settings.putProperty(WizardProperties.REPRESENTATION_TYPES, new String[]{contentClassTextField.getText()}); settings.putProperty(WizardProperties.SOURCE_GROUP, getLocationValue()); try { FileObject packageFO = SourceGroupSupport.getFolderForPackage(getLocationValue(), getPackage(), false); if (packageFO != null) { Templates.setTargetFolder(settings, packageFO); } else { Templates.setTargetFolder(settings, null); settings.putProperty(WizardProperties.TARGET_PACKAGE, getPackage()); } } catch (IOException ex) { Exceptions.printStackTrace(ex); } }
Example #9
Source File: PatternResourcesIterator.java From netbeans with Apache License 2.0 | 6 votes |
public void initialize(WizardDescriptor wizard) { this.wizard = wizard; wizard.putProperty("NewFileWizard_Title", NbBundle.getMessage(PatternResourcesIterator.class, "Templates/WebServices/RestServicesFromPatterns")); String step1Name = NbBundle.getMessage(PatternResourcesIterator.class, "LBL_Select_Pattern"); AbstractPanel patternPanel = new PatternSelectionPanel(step1Name, wizard); // NOI18N String step2Name = NbBundle.getMessage(PatternResourcesIterator.class, "LBL_Specify_Resource_Class"); PatternResourcesSetupPanel containerPanel = new PatternResourcesSetupPanel(step2Name, wizard); // NOI18N panels = new AbstractPanel[] { patternPanel, containerPanel}; current = 0; String names[] = new String[] { step1Name, step2Name }; Util.mergeSteps(wizard, panels, names); containerPanel.saveStepsAndIndex(); }
Example #10
Source File: J2SESampleProjectIterator.java From netbeans with Apache License 2.0 | 6 votes |
@Override public void initialize(WizardDescriptor templateWizard) { this.wiz = templateWizard; String displayName; try { displayName = DataObject.find(Templates.getTemplate(wiz)).getNodeDelegate().getDisplayName(); } catch (DataObjectNotFoundException ex) { displayName = "unknown"; } String name = displayName; if (name != null) { name = name.replaceAll(" ", ""); //NOI18N } templateWizard.putProperty (WizardProperties.NAME, name); basicPanel = new PanelConfigureProject(displayName); currentIndex = 0; updateStepsList (); }
Example #11
Source File: JAXBWizardIterator.java From netbeans with Apache License 2.0 | 6 votes |
public void initialize(WizardDescriptor wiz) { this.wizardDescriptor = wiz; Object prop = wiz.getProperty(WizardDescriptor.PROP_CONTENT_DATA); //NOI18N String[] beforeSteps = null; if (prop != null && prop instanceof String[]) { beforeSteps = (String[]) prop; } String[] steps = createSteps(beforeSteps, panels); // Make sure list of steps is accurate. for (int i = 0; i < panels.length; i++) { Component c = panels[i].getComponent(); if (c instanceof JComponent) { // assume Swing components JComponent jc = (JComponent) c; // Step #. jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, //NOI18N new Integer(i)); // Step name (actually the whole list for reference). jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); //NOI18N } } }
Example #12
Source File: NewFreeformProjectSupport.java From netbeans with Apache License 2.0 | 5 votes |
/** * Uninitialize Basic Project Info panel after wizard was instantiated. */ public static void uninitializeBasicProjectInfoWizardPanel(WizardDescriptor wiz) { wiz.putProperty(NewFreeformProjectSupport.PROP_ANT_SCRIPT, null); wiz.putProperty(NewFreeformProjectSupport.PROP_PROJECT_NAME, null); wiz.putProperty(NewFreeformProjectSupport.PROP_PROJECT_LOCATION, null); wiz.putProperty(NewFreeformProjectSupport.PROP_PROJECT_FOLDER, null); }
Example #13
Source File: JavaFXProjectWizardIterator.java From netbeans with Apache License 2.0 | 5 votes |
private WizardDescriptor.Panel[] createPanels() { switch (type) { case EXTISTING: return new WizardDescriptor.Panel[]{ new PanelConfigureProject(type), new PanelSourceFolders.Panel(), new PanelIncludesExcludes(),}; default: return new WizardDescriptor.Panel[]{ new PanelConfigureProject(type) }; } }
Example #14
Source File: SourceFoldersWizardPanel.java From netbeans with Apache License 2.0 | 5 votes |
public boolean isValid() { getComponent(); // Panel is valid without any source folder specified, but // Next button is enabled only when there is some soruce // folder specified -> see NewJ2SEFreeformProjectWizardIterator // which enables/disables Next button wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, ""); // NOI18N return true; }
Example #15
Source File: NewSpringXMLConfigWizardIterator.java From netbeans with Apache License 2.0 | 5 votes |
/** * Initialize panels representing individual wizard's steps and sets * various properties for them influencing wizard appearance. */ private WizardDescriptor.Panel[] getPanels() { if (panels == null) { Project p = Templates.getProject(wizard); SourceGroup[] groups = ProjectUtils.getSources(p).getSourceGroups(Sources.TYPE_GENERIC); ConfigFileManager manager = getConfigFileManager(p); List<ConfigFileGroup> configFileGroups = manager != null ? manager.getConfigFileGroups() : null; SpringXMLConfigGroupPanel configGroupPanel = configFileGroups != null && !configFileGroups.isEmpty() ? new SpringXMLConfigGroupPanel(configFileGroups) : null; WizardDescriptor.Panel targetChooser = Templates.createSimpleTargetChooser(p, groups, configGroupPanel); panels = new WizardDescriptor.Panel[] { targetChooser, new SpringXMLConfigNamespacesPanel(), }; String[] steps = createSteps(); for (int i = 0; i < panels.length; i++) { Component c = panels[i].getComponent(); if (steps[i] == null) { // Default step name to component name of panel. Mainly // useful for getting the name of the target chooser to // appear in the list of steps. steps[i] = c.getName(); } if (c instanceof JComponent) { // assume Swing components JComponent jc = (JComponent) c; // Sets step number of a component jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(i)); // NOI18N // Sets steps names for a panel jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N // Turn on subtitle creation on each step jc.putClientProperty(WizardDescriptor.PROP_AUTO_WIZARD_STYLE, Boolean.TRUE); // NOI18N // Show steps on the left side with the image on the background jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DISPLAYED, Boolean.TRUE); // NOI18N // Turn on numbering of all steps jc.putClientProperty(WizardDescriptor.PROP_CONTENT_NUMBERED, Boolean.TRUE); // NOI18N } } } return panels; }
Example #16
Source File: AddSkyboxAction.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 5 votes |
@Override protected Object showWizard(org.openide.nodes.Node node) { WizardDescriptor wizardDescriptor = new WizardDescriptor(getPanels()); wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); wizardDescriptor.setTitle("Skybox Wizard"); Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.setVisible(true); dialog.toFront(); boolean cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION; if (!cancelled) { return wizardDescriptor; } return null; }
Example #17
Source File: MdbLocationPanel.java From netbeans with Apache License 2.0 | 5 votes |
@Override public boolean isValid() { Project project = Templates.getProject(wizardDescriptor); J2eeModuleProvider j2eeModuleProvider = project.getLookup().lookup(J2eeModuleProvider.class); String j2eeVersion = j2eeModuleProvider.getJ2eeModule().getModuleVersion(); if (!EjbJar.VERSION_3_2.equals(j2eeVersion) && !EjbJar.VERSION_3_1.equals(j2eeVersion) && !EjbJar.VERSION_3_0.equals(j2eeVersion) && !EjbJar.VERSION_2_1.equals(j2eeVersion)) { wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(MdbLocationPanel.class,"MSG_WrongJ2EESpecVersion")); //NOI18N return false; } FileObject targetFolder = (FileObject) wizardDescriptor.getProperty(MultiTargetChooserPanel.TARGET_FOLDER); if (targetFolder != null) { String targetName = (String) wizardDescriptor.getProperty(MultiTargetChooserPanel.TARGET_NAME); String name = ejbNames.getMessageDrivenEjbClassPrefix() + targetName + ejbNames.getMessageDrivenEjbClassSuffix(); if (targetFolder.getFileObject(name + ".java") != null) { // NOI18N wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, // NOI18N NbBundle.getMessage(MdbLocationPanel.class, "ERR_FileAlreadyExists", name + ".java")); //NOI18N return false; } } // component/panel validation getComponent(); if (locationPanel.getDestination() == null) { wizardDescriptor.putProperty( WizardDescriptor.PROP_ERROR_MESSAGE, //NOI18N NbBundle.getMessage(MdbLocationPanel.class, "ERR_NoDestinationSelected")); return false; } if (!locationPanel.isServerConfigured()) { wizardDescriptor.putProperty( WizardDescriptor.PROP_ERROR_MESSAGE, //NOI18N NbBundle.getMessage(MdbLocationPanel.class, "ERR_MissingServer")); } return true; }
Example #18
Source File: PanelProjectLocationExtSrc.java From netbeans with Apache License 2.0 | 5 votes |
@Override void read(WizardDescriptor settings) { this.wizardDescriptor = settings; String path = null; String projectName = null; File projectLocation = (File) settings.getProperty("projdir"); // NOI18N if (projectLocation == null) { projectLocation = ProjectChooser.getProjectsFolder(); int index = WizardSettings.getNewProjectCount(); String formater = NbBundle.getMessage(PanelSourceFolders.class, "TXT_JavaProject"); // NOI18N File file; do { index++; projectName = MessageFormat.format(formater, new Object[]{new Integer(index)}); file = new File(projectLocation, projectName); } while (file.exists()); settings.putProperty(JavaFXProjectWizardIterator.PROP_NAME_INDEX, new Integer(index)); this.projectLocation.setText(projectLocation.getAbsolutePath()); this.setCalculateProjectFolder(true); } else { projectName = (String) settings.getProperty("name"); // NOI18N boolean tmpFlag = this.calculatePF; this.projectLocation.setText(projectLocation.getAbsolutePath()); this.setCalculateProjectFolder(tmpFlag); } this.projectName.setText(projectName); this.projectName.selectAll(); String buildScriptName = (String) settings.getProperty("buildScriptName"); // NOI18N if (buildScriptName == null) { assert projectLocation != null; buildScriptName = DEFAULT_BUILD_SCRIPT_NAME; File bf = new File(projectLocation, buildScriptName); if (bf.exists()) { buildScriptName = NB_BUILD_SCRIPT_NAME; } //Todo: Mybe generate other name, like nb-build2.xml - not sure if it's desirable } this.buildScriptName.setText(buildScriptName); }
Example #19
Source File: NewLibraryDescriptor.java From netbeans with Apache License 2.0 | 5 votes |
public NewLibraryDescriptor.DataModel cloneMe(WizardDescriptor wiz) { NewLibraryDescriptor.DataModel d = new NewLibraryDescriptor.DataModel(wiz); d.setLibrary(this.getLibrary()); d.setPackageName(this.getPackageName()); d.setCreatedModifiedFiles(this.getCreatedModifiedFiles()); d.setLibraryDisplayName(this.getLibraryDisplayName()); d.setLibraryName(this.getLibraryName()); return d; }
Example #20
Source File: NewEjbJarProjectWizardIterator.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void uninitialize(WizardDescriptor wiz) { this.wiz.putProperty(ProjectLocationWizardPanel.PROJECT_DIR,null); this.wiz.putProperty(ProjectLocationWizardPanel.NAME,null); this.wiz = null; panels = null; }
Example #21
Source File: WLInstantiatingIterator.java From netbeans with Apache License 2.0 | 5 votes |
private WizardDescriptor.Panel getPropertiesPanel() { if ((isRemote() && (serverPropertiesPanel instanceof ServerRemotePropertiesPanel)) || !isRemote() && (serverPropertiesPanel instanceof ServerLocalPropertiesPanel)) { return serverPropertiesPanel; } serverPropertiesPanel = isRemote() ? createRemotePanel() : createLocalPanel(); return serverPropertiesPanel; }
Example #22
Source File: CakePHP3NewProjectWizardIterator.java From cakephp3-netbeans with Apache License 2.0 | 5 votes |
@Override public void uninitialize(WizardDescriptor wiz) { this.wiz.putProperty(CakePHP3NewProjectWizardPanel.PROP_PROJ_DIR, null); this.wiz.putProperty(CakePHP3NewProjectWizardPanel.PROP_NAME, null); this.wiz.putProperty(CakePHP3NewProjectWizardPanel.PROP_PROJECT_TYPE, null); this.wiz = null; panels = null; }
Example #23
Source File: SingletonSetupPanelVisual.java From netbeans with Apache License 2.0 | 5 votes |
public boolean valid(WizardDescriptor wizard) { AbstractPanel.clearErrorMessage(wizard); String resourceUri = uriTextField.getText().trim(); String packageName = getPackage(); String className = classTextField.getText().trim(); SourceGroup[] groups = SourceGroupSupport.getJavaSourceGroups(project); if (groups == null || groups.length < 1) { AbstractPanel.setErrorMessage(wizard, "MSG_NoJavaSourceRoots"); return false; } else if (className.length() == 0 || !Utilities.isJavaIdentifier(className)) { AbstractPanel.setErrorMessage(wizard, "MSG_InvalidResourceClassName"); return false; } else if (resourceUri.length() == 0) { AbstractPanel.setErrorMessage(wizard, "MSG_EmptyUriTemplate"); return false; } else if (!Util.isValidPackageName(packageName)) { AbstractPanel.setErrorMessage(wizard, "MSG_InvalidPackageName"); return false; } else if (getResourceClassFile() != null) { AbstractPanel.setErrorMessage(wizard, "MSG_ExistingClass"); return false; } else if (!Util.isValidUri(resourceUri)) { AbstractPanel.setErrorMessage(wizard, "MSG_IncorrectUriTemplate"); return false; } return true; }
Example #24
Source File: CloneWizard.java From netbeans with Apache License 2.0 | 5 votes |
private void setErrorMessage (AbstractWizardPanel.Message msg) { if (wizardDescriptor != null) { if (msg == null) { wizardDescriptor.putProperty(WizardDescriptor.PROP_INFO_MESSAGE, null); // NOI18N wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, null); // NOI18N } else { if (msg.isInfo()) { wizardDescriptor.putProperty(WizardDescriptor.PROP_INFO_MESSAGE, msg.getMessage()); // NOI18N } else { wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, msg.getMessage()); // NOI18N } } } }
Example #25
Source File: AndroidProjectTemplatePanelVisualAndroidSettings.java From NBANDROID-V2 with Apache License 2.0 | 5 votes |
void store(WizardDescriptor d) { d.putProperty(PROP_PHONE_TABLET_ENABLED, phoneEnabled.isSelected()); d.putProperty(PROP_WEAR_ENABLED, wearEnabled.isSelected()); d.putProperty(PROP_TV_ENABLED, tvEnabled.isSelected()); d.putProperty(PROP_PHONE_TABLET_PLATFORM, phonePlatforms.getSelectedItem()); d.putProperty(PROP_WEAR_PLATFORM, wearPlatforms.getSelectedItem()); d.putProperty(PROP_TV_PLATFORM, tvPlatforms.getSelectedItem()); d.putProperty(PROP_PLATFORM_CONFIG_DONE, new Boolean[]{phoneEnabled.isSelected(), wearEnabled.isSelected(), tvEnabled.isSelected()}); d.putProperty(PROP_PHONE_TABLET_FOLDER, mobileFolder.getText().trim()); d.putProperty(PROP_WEAR_FOLDER, wearFolder.getText().trim()); d.putProperty(PROP_TV_FOLDER, tvFolder.getText().trim()); }
Example #26
Source File: PatternSelectionPanelVisual.java From netbeans with Apache License 2.0 | 5 votes |
public void read(WizardDescriptor settings) { Pattern p = (Pattern) settings.getProperty(WizardProperties.PATTERN_SELECTION); if (p == Pattern.CONTAINER) { patternButtons.setSelected(containerRadioButton.getModel(), true); } else if (p == Pattern.CLIENTCONTROLLED) { patternButtons.setSelected(clientControlledRadioButton.getModel(), true); } else { // default patternButtons.setSelected(standAloneRadioButton.getModel(), true); } setDescription(); }
Example #27
Source File: URLPatternWizard.java From netbeans with Apache License 2.0 | 5 votes |
public boolean show() { wizardIterator = new PanelsIterator(); wizardDescriptor = new WizardDescriptor(wizardIterator); wizardDescriptor.setTitleFormat(new MessageFormat("{0}")); // NOI18N wizardDescriptor.setTitle(org.openide.util.NbBundle.getMessage(URLPatternWizard.class, "CTL_URLPattern")); // NOI18N Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor); dialog.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(URLPatternWizard.class, "CTL_URLPattern")); // NOI18N dialog.setVisible(true); dialog.toFront(); return wizardDescriptor.getValue() == WizardDescriptor.FINISH_OPTION; }
Example #28
Source File: PatternResourcesIterator.java From netbeans with Apache License 2.0 | 5 votes |
private GenericResourceBean[] getResourceBeans(WizardDescriptor wizard) { Pattern p = (Pattern) wizard.getProperty(WizardProperties.PATTERN_SELECTION); if (p == Pattern.CONTAINER) { return getContainerItemBeans(wizard, GenericResourceBean.CONTAINER_METHODS); } else if (p == Pattern.STANDALONE) { return getPlainResourceBeans(wizard); } else if (p == Pattern.CLIENTCONTROLLED) { return getContainerItemBeans(wizard, GenericResourceBean.CLIENT_CONTROL_CONTAINER_METHODS); } else { throw new IllegalArgumentException("Invalid pattern "+p); } }
Example #29
Source File: DTDWizardIterator.java From netbeans with Apache License 2.0 | 5 votes |
/** * Initialization of the wizard iterator. */ public void initialize(TemplateWizard wizard) { index = 0; Project project = Templates.getProject( wizard ); panels = createPanels (project, wizard); // Creating steps. Object prop = wizard.getProperty (WizardDescriptor.PROP_CONTENT_DATA); // NOI18N String[] beforeSteps = null; if (prop instanceof String[]) { beforeSteps = (String[])prop; } String[] steps = createSteps (beforeSteps, panels); for (int i = 0; i < panels.length; i++) { Component c = panels[i].getComponent (); if (steps[i] == null) { // Default step name to component name of panel. // Mainly useful for getting the name of the target // chooser to appear in the list of steps. steps[i] = c.getName (); } if (c instanceof JComponent) { // assume Swing components JComponent jc = (JComponent) c; // Step #. jc.putClientProperty (WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(i)); // NOI18N // Step name (actually the whole list for reference). jc.putClientProperty (WizardDescriptor.PROP_CONTENT_DATA, steps); // NOI18N } } }
Example #30
Source File: ProjectAttriburesPanel.java From netbeans with Apache License 2.0 | 5 votes |
@Override public void storeSettings(WizardDescriptor wiz) { getComponent().write(wiz); if (bottomPanel != null) { bottomPanel.storeSettings(wiz); } }