Java Code Examples for org.openide.WizardDescriptor#putProperty()

The following examples show how to use org.openide.WizardDescriptor#putProperty() . 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: PanelProjectLocationVisual.java    From netbeans with Apache License 2.0 6 votes vote down vote up
boolean valid(WizardDescriptor wizardDescriptor) {
    if (projectNameTextField.getText().length() == 0) {
        wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(PanelProjectLocationVisual.class,"MSG_IllegalProjectName")); //NOI18N
        return false; // Display name not specified
    }
    
    File destFolder = new File(createdFolderTextField.getText());
    File[] children = destFolder.listFiles();
    if (destFolder.exists() && children != null && children.length > 0) {
        // Folder exists and is not empty
        wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, NbBundle.getMessage(PanelProjectLocationVisual.class,"MSG_ProjectFolderExists")); //NOI18N
        return false;
    }
            
    wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, ""); //NOI18N
    return true;
}
 
Example 2
Source File: WebServiceTypePanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
boolean valid(WizardDescriptor wizardDescriptor) {
    
    if (getServiceType() == WizardProperties.ENCAPSULATE_SESSION_BEAN &&
        jTextFieldDelegate.getText().length() == 0) {
        wizardDescriptor.putProperty(WizardDescriptor.PROP_INFO_MESSAGE, NbBundle.getMessage(WebServiceTypePanel.class, "LBL_SelectOneEJB")); //NOI18N
        return false;        
    }

    WSStackUtils.ErrorMessage message = stackUtils.getErrorMessage(WSStackUtils.WizardType.WS);
    if (message != null) {
        wizardDescriptor.putProperty(message.getWizardMessageProperty(), message.getText());
        if (message.isSerious()) {
            return false;
        }
    }

    return true;
}
 
Example 3
Source File: J2SESampleProjectIterator.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@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 4
Source File: ReactRepoWizardIterator.java    From nb-springboot with Apache License 2.0 5 votes vote down vote up
@Override
public void uninitialize(WizardDescriptor wizard) {
    wizard.putProperty(WIZ_BASE_INTERF, null);
    wizard.putProperty(WIZ_ENTITY_CLASS, null);
    wizard.putProperty(WIZ_ID_CLASS, null);
    panel = null;
}
 
Example 5
Source File: RepoWizardIterator.java    From nb-springboot with Apache License 2.0 5 votes vote down vote up
@Override
public void initialize(WizardDescriptor wizard) {
    this.wizard = wizard;
    wizard.putProperty(WIZ_BASE_INTERF, "CrudRepository");
    wizard.putProperty(WIZ_ENTITY_CLASS, "Entity");
    wizard.putProperty(WIZ_ID_CLASS, "Id");
    Project project = Templates.getProject(wizard);
    Sources src = ProjectUtils.getSources(project);
    SourceGroup[] groups = src.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
    panel = JavaTemplates.createPackageChooser(project, groups, new RepoWizardPanel1(), true);
    // force creation of visual part
    JComponent cmp = (JComponent) panel.getComponent();
    cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, new Integer(0));
    cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, TemplateUtils.createSteps(wizard, new String[]{cmp.getName()}));
}
 
Example 6
Source File: ConfigureFXMLPanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void readSettings(WizardDescriptor settings) {
    this.settings = settings;
    // Try to preselect a folder
    FileObject preselectedFolder = Templates.getTargetFolder(settings);
    // Init values
    component.initValues(Templates.getTemplate(settings), preselectedFolder);

    // XXX hack, TemplateWizard in final setTemplateImpl() forces new wizard's title
    // this name is used in NewFileWizard to modify the title
    Object substitute = component.getClientProperty("NewFileWizard_Title"); // NOI18N
    if (substitute != null) {
        settings.putProperty("NewFileWizard_Title", substitute); // NOI18N
    }
}
 
Example 7
Source File: CreateProjectVisualPanel1.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void applySettings(WizardDescriptor wiz) {
    wiz.putProperty("name", jTextField2.getText());
    wiz.putProperty("version", jTextField4.getText());
    wiz.putProperty("distributor", jTextField5.getText());
    wiz.putProperty("folder", jTextField1.getText());
    wiz.putProperty("description", jTextArea1.getText());
    wiz.putProperty("name", jTextField2.getText());
}
 
Example 8
Source File: NewFreeformProjectSupport.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * 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 9
Source File: BasicWizardIterator.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public @Override void storeSettings(WizardDescriptor wiz) {
    if (WizardDescriptor.NEXT_OPTION.equals(wiz.getValue()) ||
            WizardDescriptor.FINISH_OPTION.equals(wiz.getValue())) {
        panel.storeToDataModel();
    }
    //XXX hack
    wiz.putProperty("NewFileWizard_Title", null); // NOI18N
}
 
Example 10
Source File: PanelConfigureProject.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public void readSettings(Object settings) {
    wizardDescriptor = (WizardDescriptor)settings;        
    component.read (wizardDescriptor);
    
    // XXX hack, TemplateWizard in final setTemplateImpl() forces new wizard's title
    // this name is used in NewProjectWizard to modify the title
    Object substitute = ((JComponent)component).getClientProperty ("NewProjectWizard_Title"); // NOI18N
    if (substitute != null) {
        wizardDescriptor.putProperty ("NewProjectWizard_Title", substitute); // NOI18N
    }
}
 
Example 11
Source File: GroovyJavaDemoPanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void store(WizardDescriptor d) {
    String name = projectNameTextField.getText().trim();
    String folder = createdFolderTextField.getText().trim();

    d.putProperty("projdir", new File(folder));
    d.putProperty("name", name);
}
 
Example 12
Source File: ActEndpointWizardIterator.java    From nb-springboot with Apache License 2.0 5 votes vote down vote up
@Override
public void initialize(WizardDescriptor wizard) {
    this.wizard = wizard;
    wizard.putProperty(WIZ_TECHNOLOGY, 0);
    wizard.putProperty(WIZ_SAMPLE_OPS, true);
    Project project = Templates.getProject(wizard);
    Sources src = ProjectUtils.getSources(project);
    SourceGroup[] groups = src.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
    panel = JavaTemplates.createPackageChooser(project, groups, new ActEndpointWizardPanel1(), true);
    // force creation of visual part
    JComponent cmp = (JComponent) panel.getComponent();
    cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, 0);
    cmp.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, TemplateUtils.createSteps(wizard, new String[]{cmp.getName()}));
}
 
Example 13
Source File: ServerSelectionPanelVisual.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void write(WizardDescriptor settings) {
    if (cbVersion.getSelectedIndex() >= 0) {
        settings.putProperty(ServerSelectionPanel.PROP_PROFILE,
                cbVersion.getItemAt(cbVersion.getSelectedIndex()).toPropertiesString());
    }
    if (cbServer.getSelectedIndex() >= 0) {
        String instanceId = JavaEEServerComboBoxModel.getServerInstanceID(cbServer.getItemAt(cbServer.getSelectedIndex()));
        settings.putProperty(ServerSelectionPanel.PROP_SERVER, instanceId);
    }
}
 
Example 14
Source File: ModelImporterVisualPanel1.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void applySettings(WizardDescriptor wiz) {
    wiz.putProperty("path", currentPath);
    wiz.putProperty("assetlist", requestedAssets);
    wiz.putProperty("mainkey", mainKey);
    if (mainKey != null) {
        wiz.putProperty("destpath", "Models/" + mainKey.getName().replaceAll(mainKey.getExtension(), "").replaceAll("\\.", "") + "/");
    }
}
 
Example 15
Source File: ProjectLocationPanel.java    From netbeans with Apache License 2.0 5 votes vote down vote up
void store( WizardDescriptor d ) {                
    String name = projectNameTextField.getText().trim();
    String folder = createdFolderTextField.getText().trim();
    
    d.putProperty( ProjectLocationWizardPanel.PROJECT_DIR, new File( folder ));
    d.putProperty( ProjectLocationWizardPanel.NAME, name );
    
    d.putProperty(ProjectLocationWizardPanel.SHARED_LIBRARIES, sharableProject.isSelected() ? librariesLocation.getText() : null);
}
 
Example 16
Source File: datasourcePanelVisual.java    From visualvm with GNU General Public License v2.0 5 votes vote down vote up
void store(WizardDescriptor d) {
    String name = projectNameTextField.getText().trim();
    String folder = createdFolderTextField.getText().trim();

    d.putProperty("projdir", new File(folder));
    d.putProperty("name", name);
}
 
Example 17
Source File: GroovyJavaDemoWizardPanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void storeSettings(Object settings) {
    WizardDescriptor d = (WizardDescriptor) settings;
    component.store(d);
    d.putProperty("NewProjectWizard_Title", null); // NOI18N
}
 
Example 18
Source File: ModuleTypePanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
private static void setErrorMessage(WizardDescriptor settings, String message) {
    settings.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, message); 
}
 
Example 19
Source File: TargetMappingWizardPanel.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public void storeSettings(Object settings) {
    wizardDescriptor = (WizardDescriptor)settings;        
    wizardDescriptor.putProperty(PROP_TARGET_MAPPINGS, component.getMapping());
    wizardDescriptor.putProperty("NewProjectWizard_Title", null); // NOI18N
}
 
Example 20
Source File: HtmlPanelVisual.java    From netbeans with Apache License 2.0 4 votes vote down vote up
void store( WizardDescriptor descriptor ) {
    descriptor.putProperty(HtmlPanel.HTML_FILE, getCreatedFilePath());
}