本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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
}
}
示例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);
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}