org.netbeans.spi.project.ui.support.ProjectChooser Java Examples

The following examples show how to use org.netbeans.spi.project.ui.support.ProjectChooser. 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: ProjectProblemsProviders.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
@NonNull
@NbBundle.Messages({
    "LBL_BrokenLinksCustomizer_Resolve_Project=Browse Project \"{0}\""
})
public Future<ProjectProblemsProvider.Result> resolve() {
    ProjectProblemsProvider.Status result = ProjectProblemsProvider.Status.UNRESOLVED;
    final JFileChooser chooser = ProjectChooser.projectChooser();
    chooser.setDialogTitle(LBL_BrokenLinksCustomizer_Resolve_Project(getDisplayId(type, id)));
    if (lastSelectedFile != null) {
        chooser.setSelectedFile(lastSelectedFile);
    }
    int option = chooser.showOpenDialog(null);
    if (option == JFileChooser.APPROVE_OPTION) {
        updateReference(chooser.getSelectedFile());
        lastSelectedFile = chooser.getSelectedFile();
        result = ProjectProblemsProvider.Status.RESOLVED;
    }
    return new Done(ProjectProblemsProvider.Result.create(result));
}
 
Example #2
Source File: PanelProjectLocationVisual.java    From netbeans with Apache License 2.0 6 votes vote down vote up
void read (WizardDescriptor settings) {
        File projectLocation = (File) settings.getProperty(WizardProperties.PROJECT_DIR);
        if (projectLocation == null)
            projectLocation = ProjectChooser.getProjectsFolder();
        else
            projectLocation = projectLocation.getParentFile();
        
        projectLocationTextField.setText(projectLocation.getAbsolutePath());
        
        String formater = null;
        String projectName = (String) settings.getProperty(WizardProperties.NAME);
        
        if (projectName == null) {
            formater = NbBundle.getMessage(PanelProjectLocationVisual.class, "LBL_NPW1_DefaultProjectName"); //NOI18N
        } else {
            formater = projectName + "{0}"; //NOI18N
        }
        if ((projectName == null) || (validFreeProjectName(projectLocation, projectName) == null)) {
            int baseCount = FoldersListSettings.getDefault().getNewProjectCount() + 1;
            while ((projectName = validFreeProjectName(projectLocation, formater, baseCount)) == null)
                baseCount++;
//            settings.putProperty(NewWebProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
        }
        projectNameTextField.setText(projectName);
        projectNameTextField.selectAll();
    }
 
Example #3
Source File: BasicProjectInfoPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void browseProjectFolderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseProjectFolderActionPerformed
    JFileChooser chooser = new JFileChooser();
    FileUtil.preventFileChooserSymlinkTraversal(chooser, null);
    chooser.setFileSelectionMode (JFileChooser.DIRECTORIES_ONLY);
    if (projectFolder.getText().length() > 0 && getProjectFolder().exists()) {
        chooser.setSelectedFile(getProjectFolder());
    } else if (projectLocation.getText().length() > 0 && getProjectLocation().exists()) {
        chooser.setSelectedFile(getProjectLocation());
    } else {
        chooser.setSelectedFile(ProjectChooser.getProjectsFolder());
    }
    chooser.setDialogTitle(NbBundle.getMessage(BasicProjectInfoPanel.class, "LBL_Browse_Project_Folder"));  //NOI18N
    if ( JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
        File projectDir = FileUtil.normalizeFile(chooser.getSelectedFile());
        projectFolder.setText(projectDir.getAbsolutePath());
    }                    
}
 
Example #4
Source File: OnlineSampleVisualPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initFields() {
    final String projectName = (String) descriptor.getProperty(WizardConstants.SAMPLE_PROJECT_NAME);
    final String projectURL = (String) descriptor.getProperty(WizardConstants.SAMPLE_PROJECT_URL);

    templateUrlTextField.setText(projectURL);

    // default name & location
    File projectLocation = ProjectChooser.getProjectsFolder();
    projectLocationTextField.setText(projectLocation.getAbsolutePath());

    projectNameTextField.setText(findName(projectLocation, projectName));
    projectNameTextField.selectAll();
    createdFolderTextField.setText(getProjectLocation() + File.separatorChar + getProjectName());

    // listeners
    DocumentListener documentListener = new DefaultDocumentListener();
    projectNameTextField.getDocument().addDocumentListener(documentListener);
    projectLocationTextField.getDocument().addDocumentListener(documentListener);
    setName(NbBundle.getMessage(OnlineSampleVisualPanel.class, "LBL_NameAndLocation"));
}
 
Example #5
Source File: OnlineSampleVisualPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
    File workDir = null;
    String projectLocation = getProjectLocation();
    if (projectLocation != null && !projectLocation.isEmpty()) {
        File projDir = new File(projectLocation);
        if (projDir.isDirectory()) {
            workDir = projDir;
        }
    }
    if (workDir == null) {
        workDir = ProjectChooser.getProjectsFolder();
    }
    File projectDir = new FileChooserBuilder(SampleVisualPanel.class)
    .setTitle(NbBundle.getMessage(SampleVisualPanel.class, "TTL_DialogLocation"))   // NOI18N
    .setDirectoriesOnly(true)
    .setDefaultWorkingDirectory(workDir)
    .forceUseOfDefaultWorkingDirectory(true)
    .showOpenDialog();
    if (projectDir != null) {
        projectLocationTextField.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath());
    }
}
 
Example #6
Source File: apptypePanelVisual.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
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 = "apptype";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #7
Source File: IDENativeMavenWizardIterator.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
@Messages({"PRG_Dir=Creating directory", "PRG_FINISH=Finishing..."})
public Set<FileObject> instantiate (ProgressHandle handle) throws IOException {
    handle.start();
    try {
        handle.progress(Bundle.PRG_Dir());
        ProjectInfo vi = new ProjectInfo((String) wiz.getProperty("groupId"), (String) wiz.getProperty("artifactId"), (String) wiz.getProperty("version"), (String) wiz.getProperty("package")); //NOI18N
        String[] splitlog = StringUtils.split(log, ":");
        ArchetypeWizardUtils.logUsage(splitlog[0], splitlog[1], splitlog[2]);
        File projFile = FileUtil.normalizeFile((File) wiz.getProperty(CommonProjectActions.PROJECT_PARENT_FOLDER)); // NOI18N
        final File parent = projFile.getParentFile();
        if (parent != null && parent.exists()) {
            ProjectChooser.setProjectsFolder(parent);
        }
        CreateProjectBuilder builder = createBuilder(projFile, vi, handle);
        builder.create();
        handle.progress(Bundle.PRG_FINISH());
        return ArchetypeWizardUtils.openProjects(projFile, null);   
    } finally {
        handle.finish();
    }
}
 
Example #8
Source File: PanelProjectLocationVisual.java    From netbeans with Apache License 2.0 6 votes vote down vote up
void read (WizardDescriptor settings) {
    File projectLocation = (File) settings.getProperty ("projdir");  //NOI18N
    if (projectLocation == null || projectLocation.getParentFile() == null ||
        (projectLocation.getParentFile().exists() && !projectLocation.getParentFile().isDirectory ())) {
        projectLocation = ProjectChooser.getProjectsFolder();
    }
    else {
        projectLocation = projectLocation.getParentFile();
    }
    this.projectLocationTextField.setText (projectLocation.getAbsolutePath());
    
    String projectName = (String) settings.getProperty ("name"); //NOI18N
    if (projectName == null) {
        int baseCount = WizardSettings.getNewProjectCount() + 1;
        String formatter = NbBundle.getMessage(PanelProjectLocationVisual.class, "TXT_JavaModuleApplication");
        while ((projectName=validFreeProjectName(projectLocation, formatter, baseCount))==null)
            baseCount++;                
        settings.putProperty (NewJ2SEModularProjectWizardIterator.PROP_NAME_INDEX, new Integer(baseCount));
    }
    this.projectNameTextField.setText (projectName);                
    this.projectNameTextField.selectAll();
}
 
Example #9
Source File: SampleVisualPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void initProjectNameAndLocation(WizardDescriptor descriptor) {
    // default name & location
    File projectLocation = ProjectChooser.getProjectsFolder();
    projectLocationTextField.setText(projectLocation.getAbsolutePath());

    FileObject template = Templates.getTemplate(descriptor);
    String projectName = template.getName();
    String templateName = projectName;
    int index = 0;
    while ((new File(projectLocation, projectName)).exists()) {
        index++;
        projectName = templateName + index;
    }
    projectNameTextField.setText(projectName);
    projectNameTextField.selectAll();
    updateProjectFolder();

    // listeners
    DocumentListener documentListener = new DefaultDocumentListener();
    projectNameTextField.getDocument().addDocumentListener(documentListener);
    projectLocationTextField.getDocument().addDocumentListener(documentListener);
    setName(NbBundle.getMessage(SampleVisualPanel.class, "LBL_NameAndLocation"));// NOI18N
    
}
 
Example #10
Source File: SampleVisualPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
    File workDir = null;
    String projectLocation = getProjectLocation();
    if (projectLocation != null && !projectLocation.isEmpty()) {
        File projDir = new File(projectLocation);
        if (projDir.isDirectory()) {
            workDir = projDir;
        }
    }
    if (workDir == null) {
        workDir = ProjectChooser.getProjectsFolder();
    }
    File projectDir = new FileChooserBuilder(SampleVisualPanel.class)
            .setTitle(NbBundle.getMessage(SampleVisualPanel.class, "TTL_DialogLocation"))   // NOI18N
            .setDirectoriesOnly(true)
            .setDefaultWorkingDirectory(workDir)
            .forceUseOfDefaultWorkingDirectory(true)
            .showOpenDialog();
    if (projectDir != null) {
        projectLocationTextField.setText(FileUtil.normalizeFile(projectDir).getAbsolutePath());
    }
}
 
Example #11
Source File: ApisupportAntUIUtils.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public static Project chooseProject(Component parent) {
    JFileChooser chooser = ProjectChooser.projectChooser();
    int option = chooser.showOpenDialog(parent);
    Project project = null;
    if (option == JFileChooser.APPROVE_OPTION) {
        File projectDir = chooser.getSelectedFile();
        ApisupportAntUIUtils.setProjectChooserDirParent(projectDir);
        try {
            project = ProjectManager.getDefault().findProject(
                    FileUtil.toFileObject(projectDir));
        } catch (IOException e) {
            ErrorManager.getDefault().notify(ErrorManager.WARNING, e);
        }
    }
    return project;
}
 
Example #12
Source File: SelectProjectPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void btnProjectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnProjectActionPerformed
    JFileChooser chooser = ProjectChooser.projectChooser();
    int res = chooser.showOpenDialog(SwingUtilities.getWindowAncestor(this));
    if (res == JFileChooser.APPROVE_OPTION) {
        File fil = chooser.getSelectedFile();
        FileObject fo = FileUtil.toFileObject(fil);
        if (fo != null) {
            try {
                Project p = ProjectManager.getDefault().findProject(fo);
                DefaultComboBoxModel model = (DefaultComboBoxModel)comProject.getModel();
                model.addElement(p);
                model.setSelectedItem(p);
                if (EMPTY == model.getElementAt(0)) {
                    model.removeElement(EMPTY);
                }
            } catch (IOException exc) {
                ErrorManager.getDefault().notify(exc);
            }
        }
    }
}
 
Example #13
Source File: ProjectAttributesPanelVisual.java    From netbeans with Apache License 2.0 6 votes vote down vote up
void read(WizardDescriptor settings) {
    File loc = (File) settings.getProperty(CommonProjectActions.PROJECT_PARENT_FOLDER);
    if (loc == null || loc.getParentFile() == null || !loc.getParentFile().isDirectory()) {
        loc = ProjectChooser.getProjectsFolder();
    }
    tfProjectLocation.setText(loc.getAbsolutePath());

    String name = (String) settings.getProperty(PROP_NAME);

    name = name != null ? name : firstAvailableName(loc, "gradleproject"); //NOI18N
    tfProjectName.setText(name);

    setText(tfGroup, settings, PROP_GROUP);
    setText(tfVersion, settings, PROP_VERSION);
    setText(tfDescription, settings, PROP_DESCRIPTION);
    setText(tfPackageBase, settings, PROP_PACKAGE_BASE);

    Boolean initWrapper = (Boolean) settings.getProperty(PROP_INIT_WRAPPER);
    cbInitWrapper.setSelected(initWrapper != null ? initWrapper: false);

    Boolean changedPkg = (Boolean) settings.getProperty(PROP_CHANGED_PKG);
    changedPackageBase = changedPkg == null ? false : changedPkg;

    tfProjectName.selectAll();

}
 
Example #14
Source File: BasicGamePanelVisual.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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 = "BasicGame";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #15
Source File: hellovvmPanelVisual.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
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 = "hellovvm";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #16
Source File: GroovyJavaDemoPanelVisual.java    From netbeans with Apache License 2.0 6 votes vote down vote up
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 #17
Source File: CakePHP3NewProjectPanelVisual.java    From cakephp3-netbeans with Apache License 2.0 6 votes vote down vote up
void read(WizardDescriptor settings) {
    File projectLocation = (File) settings.getProperty(CakePHP3NewProjectWizardPanel.PROP_PROJ_DIR);
    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(CakePHP3NewProjectWizardPanel.PROP_NAME);
    if (projectName == null) {
        projectName = "cakephp"; // NOI18N
    }
    projectName = FileUtil.findFreeFolderName(FileUtil.toFileObject(projectLocation), projectName);
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #18
Source File: ProjectImportLocationPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
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 #19
Source File: ProjectImportLocationPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void jButtonPrjLocationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPrjLocationActionPerformed
    JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    chooser.setMultiSelectionEnabled(false);
    chooser.setAcceptAllFileFilterUsed(false);
    chooser.setDialogTitle(NbBundle.getMessage(ProjectImportLocationPanel.class, "LBL_IW_BrowseProjectFolder"));
    File lastUsed = UserProjectSettings.getDefault().getLastChooserLocation();
    if (lastUsed != null) {
        chooser.setCurrentDirectory(lastUsed.getParentFile());
    } else {
        chooser.setSelectedFile(ProjectChooser.getProjectsFolder());
    }
    if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
        File projectDir = chooser.getSelectedFile();
        projectLocationTextField.setText( projectDir.getAbsolutePath());
        UserProjectSettings.getDefault().setLastChooserLocation(projectDir);
    }            
}
 
Example #20
Source File: pluggableViewDemoSuitePanelVisual.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
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 = "pluggableViewDemoSuite";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #21
Source File: PanelProjectLocationVisual.java    From netbeans with Apache License 2.0 6 votes vote down vote up
void read (WizardDescriptor settings) {
    File projectLocation = (File) settings.getProperty(WizardProperties.PROJECT_DIR);
    if (projectLocation == null)
        projectLocation = ProjectChooser.getProjectsFolder();
    else
        projectLocation = projectLocation.getParentFile();
    
    projectLocationTextField.setText(projectLocation.getAbsolutePath());
    
    String formater = null;
    String projectName = (String) settings.getProperty(WizardProperties.NAME);
    
    if (projectName == null) {
        formater = NbBundle.getMessage(PanelProjectLocationVisual.class, "LBL_NPW1_DefaultProjectName"); //NOI18N
    } else {
        formater = projectName + "{0}"; //NOI18N
    }
    if ((projectName == null) || (validFreeProjectName(projectLocation, projectName) == null)) {
        int baseCount = 1;
        while ((projectName = validFreeProjectName(projectLocation, formater, baseCount)) == null) {
            baseCount++;
        }
    }
    projectNameTextField.setText(projectName);
    projectNameTextField.selectAll();
}
 
Example #22
Source File: PanelProjectLocationVisual.java    From netbeans with Apache License 2.0 6 votes vote down vote up
void read (WizardDescriptor d) {
    File projectLocation = (File) d.getProperty ("projectFolder");  //NOI18N
    if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory ()) {
        projectLocation = ProjectChooser.getProjectsFolder();
    } else {
        projectLocation = projectLocation.getParentFile();
    }
    
    Integer count = (Integer) d.getProperty("WizardPanel_GrailsProjectCounter");
    String formater = NbBundle.getMessage(PanelProjectLocationVisual.class, "TXT_GrailsApplication");
    
    int baseCount = count.intValue();
    
    String newPrjName = (String) d.getProperty ("name"); //NOI18N
    if (newPrjName == null) {        
        while ((newPrjName = validFreeProjectName(projectLocation, formater, baseCount)) == null) {
            baseCount++;
        }
    }
    
    projectLocationTextField.setText(projectLocation.getAbsolutePath());
    projectFolderTextField.setText( projectLocation.getAbsolutePath() + File.separatorChar + projectNameTextField.getText().trim() );
    projectNameTextField.setText(newPrjName);
}
 
Example #23
Source File: JmeTestsPanelVisual.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 6 votes vote down vote up
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 = "JmeTests";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #24
Source File: jvmcapsPanelVisual.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
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 = "jvmcaps";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #25
Source File: hostviewPanelVisual.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
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 = "hostview";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #26
Source File: CreateJobPanel.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void browseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseActionPerformed
    JFileChooser chooser = ProjectChooser.projectChooser();
    chooser.showOpenDialog(this);
    File dir = chooser.getSelectedFile();
    if (dir != null) {
        FileObject d = FileUtil.toFileObject(dir);
        if (d != null) {
            try {
                Project p = ProjectManager.getDefault().findProject(d);
                if (p != null) {
                    manuallyAddedProjects.add(p);
                    updateProjectModel();
                    project.setSelectedItem(p);
                }
            } catch (IOException x) {
                Exceptions.printStackTrace(x);
            }
        }
    }
}
 
Example #27
Source File: AndroidProjectTemplatePanelVisualBasicSettings.java    From NBANDROID-V2 with Apache License 2.0 6 votes vote down vote up
void read(WizardDescriptor settings) {
    File projectLocation = (File) settings.getProperty(PROP_PROJECT_DIR);
    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(PROP_PROJECT_NAME);
    if (projectName == null) {
        projectName = "NewAndroidProject";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
    domain.setText((String) settings.getProperty(PROP_PROJECT_DOMAIN));
    packageName.setText((String) settings.getProperty(PROP_PROJECT_PACKAGE));
    sdkList.setSelectedItem(settings.getProperty(PROP_PROJECT_SDK));
}
 
Example #28
Source File: InitializrProjectPanelVisual3.java    From nb-springboot with Apache License 2.0 6 votes vote down vote up
void read(WizardDescriptor settings) {
    File projectLocation = (File) settings.getProperty(WIZ_PROJ_LOCATION);
    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(WIZ_PROJ_NAME);
    if (projectName == null) {
        projectName = "InitializrSpringbootProject";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
    this.chUseSBMavenPlugin.setSelected((boolean) settings.getProperty(WIZ_USE_SB_MVN_PLUGIN));
    this.chRemoveWrapper.setSelected((boolean) settings.getProperty(WIZ_REMOVE_MVN_WRAPPER));
}
 
Example #29
Source File: subnodesPanelVisual.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
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 = "subnodes";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}
 
Example #30
Source File: datasourcePanelVisual.java    From visualvm with GNU General Public License v2.0 6 votes vote down vote up
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 = "datasource";
    }
    this.projectNameTextField.setText(projectName);
    this.projectNameTextField.selectAll();
}