当前位置: 首页>>代码示例>>Java>>正文


Java ProjectChooser.setProjectsFolder方法代码示例

本文整理汇总了Java中org.netbeans.spi.project.ui.support.ProjectChooser.setProjectsFolder方法的典型用法代码示例。如果您正苦于以下问题:Java ProjectChooser.setProjectsFolder方法的具体用法?Java ProjectChooser.setProjectsFolder怎么用?Java ProjectChooser.setProjectsFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.spi.project.ui.support.ProjectChooser的用法示例。


在下文中一共展示了ProjectChooser.setProjectsFolder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFromArchetype

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
public static void createFromArchetype(File projDir, ProjectInfo vi, Archetype arch, @NullAllowed Map<String,String> additional, boolean updateLastUsedProjectDir) throws IOException {
    final File parent = projDir.getParentFile();
    if (parent == null) {
        throw new IOException("no parent of " + projDir);
    }
    if (updateLastUsedProjectDir && parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }
    if (!parent.isDirectory() && !parent.mkdirs()) {
        throw new IOException("could not create " + parent);
    }
    runArchetype(parent, vi, arch, additional);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ArchetypeWizardUtils.java

示例2: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
@Override
public Set<FileObject> instantiate() throws IOException {
    Set<FileObject> resultSet = new LinkedHashSet<>();
    File projectRootDir = FileUtil.normalizeFile((File) wizard.getProperty("projdir"));
    projectRootDir.mkdirs();
    
    FileObject projectRootFO = FileUtil.toFileObject(projectRootDir);
    File mainFile = PlatformIO.addSourceFileToProject( projectRootDir, getClass().getResourceAsStream("main.cpp"), "main.cpp" );
    PlatformIO.addPrivateConfigFileToProject( projectRootDir, getClass().getResourceAsStream("configurations.xml"), "configurations.xml" );
    
    resultSet.add( projectRootFO );
    resultSet.add( FileUtil.toFileObject(mainFile) );

    File parent = projectRootDir.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }

    return resultSet;
}
 
开发者ID:gholdys,项目名称:nbpio,代码行数:21,代码来源:NbpioWizardIterator.java

示例3: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
public Set<FileObject> instantiate() throws IOException {
    Set<FileObject> mySet = new LinkedHashSet<FileObject>();
    //create folders
    File dirF = FileUtil.normalizeFile(new File((String) wiz.getProperty("folder")));
    dirF.mkdirs();

    //unzip file
    FileObject template = Templates.getTemplate(wiz);
    FileObject dir = FileUtil.toFileObject(dirF);
    unZipFile(template.getInputStream(), dir);

    // Always open top dir as a project:
    mySet.add(dir);

    File parent = dirF.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }

    return mySet;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:22,代码来源:CreateProjectWizardIterator.java

示例4: createNewProject

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
@Override
public void createNewProject(File workingDir) {
    Action newProjectAction = CommonProjectActions.newProjectAction();
    if (newProjectAction != null) {
        ProjectChooser.setProjectsFolder(workingDir);
        newProjectAction.actionPerformed(new ActionEvent(this,
                ActionEvent.ACTION_PERFORMED, "command")); // NOI18N
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ProjectServicesImpl.java

示例5: setProjectChooserDir

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
/**
 * Calls in turn {@link ProjectChooser#setProjectsFolder} if the
 * <code>folder</code> is not <code>null</code> and is a directory.
 */
public static void setProjectChooserDir(File folder) {
    if (folder == null || !folder.isDirectory()) {
        return;
    }
    ProjectChooser.setProjectsFolder(folder);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ApisupportAntUIUtils.java

示例6: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
@Override
public Set<FileObject> instantiate (ProgressHandle handle) throws IOException {
    final WizardDescriptor myWiz = this.wiz;
    if (myWiz == null) {
        LOG.warning("The uninitialize called before instantiate."); //NOI18N
        return Collections.emptySet();
    }
    handle.start (3);
    Set<FileObject> resultSet = new HashSet<>();
    File dirF = (File)myWiz.getProperty("projdir"); //NOI18N
    if (dirF == null) {
        throw new NullPointerException ("projdir == null, props:" + myWiz.getProperties()); //NOI18N
    }
    dirF = FileUtil.normalizeFile(dirF);
    String name = (String)myWiz.getProperty("name"); //NOI18N
    JavaPlatform platform = (JavaPlatform)myWiz.getProperty("javaPlatform"); //NOI18N
    handle.progress (NbBundle.getMessage (NewJ2SEModularProjectWizardIterator.class, "LBL_NewJ2SEModuleProjectWizardIterator_WizardProgress_CreatingProject"), 1);
    J2SEModularProjectGenerator.createProject(dirF, name, platform);
    handle.progress (2);
    FileObject dir = FileUtil.toFileObject(dirF);

    // Returning FileObject of project diretory.
    // Project will be open and set as main
    final Integer ind = (Integer) myWiz.getProperty(PROP_NAME_INDEX);
    if (ind != null) {
        WizardSettings.setNewProjectCount(ind);
    }
    resultSet.add (dir);
    handle.progress (NbBundle.getMessage (NewJ2SEModularProjectWizardIterator.class, "LBL_NewJ2SEModuleProjectWizardIterator_WizardProgress_PreparingToOpen"), 3);
    dirF = (dirF != null) ? dirF.getParentFile() : null;
    if (dirF != null && dirF.exists()) {
        ProjectChooser.setProjectsFolder (dirF);
    }

    SharableLibrariesUtils.setLastProjectSharable(false);
    return resultSet;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:NewJ2SEModularProjectWizardIterator.java

示例7: store

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
void store(WizardDescriptor d) {        
    String name = projectNameTextField.getText().trim();
    
    d.putProperty(WizardProperties.PROJECT_DIR, new File(createdFolderTextField.getText().trim()));
    d.putProperty(WizardProperties.NAME, name);
    
    File projectsDir = new File(this.projectLocationTextField.getText());
    if (projectsDir.isDirectory()) {
        ProjectChooser.setProjectsFolder (projectsDir);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:PanelProjectLocationVisual.java

示例8: instantiateNEW

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
public Set/*<FileObject>*/ instantiateNEW(/*ProgressHandle handle*/) throws IOException {
    Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
    File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
    dirF.mkdirs();

    FileObject template = Templates.getTemplate(wiz);
    FileObject dir = FileUtil.toFileObject(dirF);
    unZipFile(template.getInputStream(), dir);
    substituteFiles(dirF);
    // Always open top dir as a project:
    resultSet.add(dir);
    // Look for nested projects to open as well:
    Enumeration<? extends FileObject> e = dir.getFolders(true);
    while (e.hasMoreElements()) {
        FileObject subfolder = e.nextElement();
        if (ProjectManager.getDefault().isProject(subfolder)) {
            resultSet.add(subfolder);
        }
    }

    File parent = dirF.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }

    return resultSet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:28,代码来源:ExampleBotProjectWizardIterator.java

示例9: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
public Set/*<FileObject>*/ instantiate(/*ProgressHandle handle*/) throws IOException {
    Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
    File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
    dirF.mkdirs();

    FileObject template = Templates.getTemplate(wiz);
    FileObject dir = FileUtil.toFileObject(dirF);
    unZipFile(template.getInputStream(), dir);
    substituteFiles(dirF);
    // Always open top dir as a project:
    resultSet.add(dir);
    // Look for nested projects to open as well:
    Enumeration<? extends FileObject> e = dir.getFolders(true);
    while (e.hasMoreElements()) {
        FileObject subfolder = e.nextElement();
        if (ProjectManager.getDefault().isProject(subfolder)) {
            resultSet.add(subfolder);
        }
    }

    File parent = dirF.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }

    return resultSet;
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:28,代码来源:ExampleBotProjectWizardIterator.java

示例10: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
@Override
public Set/*<FileObject>*/ instantiate(/*ProgressHandle handle*/) throws IOException {
    Set<FileObject> resultSet = new LinkedHashSet<>();
    File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
    dirF.mkdirs();

    FileObject template = Templates.getTemplate(wiz);
    FileObject dir = FileUtil.toFileObject(dirF);
    unZipFile(template.getInputStream(), dir);

    // Always open top dir as a project:
    resultSet.add(dir);
    // Look for nested projects to open as well:
    Enumeration<? extends FileObject> e = dir.getFolders(true);
    while (e.hasMoreElements()) {
        FileObject subfolder = e.nextElement();
        if (ProjectManager.getDefault().isProject(subfolder)) {
            resultSet.add(subfolder);
        }
    }

    File parent = dirF.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }

    return resultSet;
}
 
开发者ID:onekosha,项目名称:nb-clojure,代码行数:29,代码来源:ClojureTemplateWizardIterator.java

示例11: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
public Set/*<FileObject>*/ instantiate(/*ProgressHandle handle*/) throws IOException {
    Set<FileObject> resultSet = new LinkedHashSet<>();
    File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
    dirF.mkdirs();

    FileObject template = Templates.getTemplate(wiz);
    FileObject dir = FileUtil.toFileObject(dirF);
    unZipFile(template.getInputStream(), dir);

    // Always open top dir as a project:
    resultSet.add(dir);
    // Look for nested projects to open as well:
    Enumeration<? extends FileObject> e = dir.getFolders(true);
    while (e.hasMoreElements()) {
        FileObject subfolder = e.nextElement();
        if (ProjectManager.getDefault().isProject(subfolder)) {
            resultSet.add(subfolder);
        }
    }

    File parent = dirF.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }

    return resultSet;
}
 
开发者ID:btraceio,项目名称:btrace.nb,代码行数:28,代码来源:BtraceLibraryWizardIterator.java

示例12: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
@Override
public Set<FileObject> instantiate(ProgressHandle handle) throws IOException {
    handle.start(4);
    Set<FileObject> resultSet = new LinkedHashSet<>();
    File fDir = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
    fDir.mkdirs();
    handle.progress(1);
    FileObject foDir = FileUtil.toFileObject(fDir);
    FileObject template = URLMapper.findFileObject(getClass().getResource("BasicSpringbootProject.zip"));
    unZipFile(template.getInputStream(), foDir);
    handle.progress(2);
    // create nbactions.xml file
    createNbActions(foDir);
    // clear non project cache
    ProjectManager.getDefault().clearNonProjectCache();
    // Always open top dir as a project:
    resultSet.add(foDir);
    // open pom.xml file
    final FileObject foPom = foDir.getFileObject("pom.xml");
    if (foPom != null) {
        resultSet.add(foPom);
    }
    handle.progress(3);
    // trigger download of dependencies
    Project prj = ProjectManager.getDefault().findProject(foDir);
    if (prj != null) {
        final NbMavenProject mvn = prj.getLookup().lookup(NbMavenProject.class);
        if (mvn != null) {
            mvn.downloadDependencyAndJavadocSource(false);
        }
    }
    // remember folder for creation of new projects
    File parent = fDir.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }
    handle.finish();
    return resultSet;
}
 
开发者ID:AlexFalappa,项目名称:nb-springboot,代码行数:40,代码来源:BasicProjectWizardIterator.java

示例13: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
public Set/*<FileObject>*/ instantiate(/*ProgressHandle handle*/) throws IOException {
    Set<FileObject> resultSet = new LinkedHashSet<FileObject>();
    File dirF = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
    dirF.mkdirs();

    FileObject template = Templates.getTemplate(wiz);
    FileObject dir = FileUtil.toFileObject(dirF);
    unZipFile(template.getInputStream(), dir);

    // Always open top dir as a project:
    resultSet.add(dir);
    // Look for nested projects to open as well:
    Enumeration<? extends FileObject> e = dir.getFolders(true);
    while (e.hasMoreElements()) {
        FileObject subfolder = e.nextElement();
        if (ProjectManager.getDefault().isProject(subfolder)) {
            resultSet.add(subfolder);
        }
    }

    File parent = dirF.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }

    return resultSet;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:28,代码来源:JME3TestsAndroidWizardIterator.java

示例14: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
@Override
public Set<FileObject> instantiate() throws IOException {
    Set<FileObject> resultSet = new LinkedHashSet<>();
    File dirF = FileUtil.normalizeFile((File) wizard.getProperty("projdir"));
    dirF.mkdirs();

    FileObject template = Templates.getTemplate(wizard);
    FileObject dir = FileUtil.toFileObject(dirF);
    unZipFile(template.getInputStream(), dir);

    // Always open top dir as a project:
    resultSet.add(dir);
    // Look for nested projects to open as well:
    Enumeration<? extends FileObject> e = dir.getFolders(true);
    while (e.hasMoreElements()) {
        FileObject subfolder = e.nextElement();
        if (ProjectManager.getDefault().isProject(subfolder)) {
            resultSet.add(subfolder);
        }
    }

    File parent = dirF.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }
    
    postCreationStep(dirF);

    return resultSet;
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:31,代码来源:SalesforceProjectWizardIterator.java

示例15: instantiate

import org.netbeans.spi.project.ui.support.ProjectChooser; //导入方法依赖的package包/类
@Override
public Set instantiate(ProgressHandle ph) throws IOException {
    ph.switchToIndeterminate();
    ph.start();
    ph.progress("Processing...");

    if (asposeMavenependencies.isStoreSettingCalled()) {
        asposeMavenependencies.performFinish();
    }

    Set<FileObject> resultSet = new LinkedHashSet<FileObject>();

    File projectDir = FileUtil.normalizeFile((File) wiz.getProperty("projdir"));
    projectDir.mkdirs();

    FileObject template = Templates.getTemplate(wiz);
    FileObject projectRoot = FileUtil.toFileObject(projectDir);
    
    createAsposeMavenProject(template.getInputStream(), projectRoot);

    createStartupPackage(projectRoot);
  
    resultSet.add(projectRoot);
    // Look for nested projects to open as well:
    Enumeration<? extends FileObject> e = projectRoot.getFolders(true);
    while (e.hasMoreElements()) {
        FileObject subfolder = e.nextElement();
        if (ProjectManager.getDefault().isProject(subfolder)) {
            resultSet.add(subfolder);
        }
    }

    File parent = projectDir.getParentFile();
    if (parent != null && parent.exists()) {
        ProjectChooser.setProjectsFolder(parent);
    }
    ph.finish();
    return resultSet;
}
 
开发者ID:asposemarketplace,项目名称:Aspose_Maven_for_NetBeans,代码行数:40,代码来源:AsposeMavenWizardIterator.java


注:本文中的org.netbeans.spi.project.ui.support.ProjectChooser.setProjectsFolder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。