本文整理汇总了Java中org.netbeans.spi.project.ui.support.ProjectChooser类的典型用法代码示例。如果您正苦于以下问题:Java ProjectChooser类的具体用法?Java ProjectChooser怎么用?Java ProjectChooser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProjectChooser类属于org.netbeans.spi.project.ui.support包,在下文中一共展示了ProjectChooser类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: resolve
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
@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));
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ProjectProblemsProviders.java
示例3: chooseProject
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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;
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ApisupportAntUIUtils.java
示例4: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:PanelProjectLocationVisual.java
示例5: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:PanelProjectLocationVisual.java
示例6: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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();
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:PanelProjectLocationVisual.java
示例7: browseProjectFolderActionPerformed
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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());
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:BasicProjectInfoPanel.java
示例8: browseAntScriptActionPerformed
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
private void browseAntScriptActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseAntScriptActionPerformed
JFileChooser chooser = new JFileChooser();
FileUtil.preventFileChooserSymlinkTraversal(chooser, null);
chooser.setFileSelectionMode (JFileChooser.FILES_ONLY);
if (antScript.getText().length() > 0 && getAntScript().exists()) {
chooser.setSelectedFile(getAntScript());
} else if (projectLocation.getText().length() > 0 && getProjectLocation().exists()) {
chooser.setSelectedFile(getProjectLocation());
} else {
chooser.setSelectedFile(ProjectChooser.getProjectsFolder());
}
chooser.setDialogTitle(NbBundle.getMessage(BasicProjectInfoPanel.class, "LBL_Browse_Build_Script")); //NOI18N
if ( JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
File script = FileUtil.normalizeFile(chooser.getSelectedFile());
antScript.setText(script.getAbsolutePath());
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:BasicProjectInfoPanel.java
示例9: btnProjectActionPerformed
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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);
}
}
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:SelectProjectPanel.java
示例10: browseActionPerformed
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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);
}
}
}
}
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:CreateJobPanel.java
示例11: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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 = "JavaBot";
}
this.projectNameTextField.setText(projectName);
this.projectNameTextField.selectAll();
}
开发者ID:kefik,项目名称:Pogamut3,代码行数:17,代码来源:ExampleBotProjectPanelVisual.java
示例12: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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 = "ClojureProjectTemplate";
}
this.projectNameTextField.setText(projectName);
this.projectNameTextField.selectAll();
}
开发者ID:onekosha,项目名称:nb-clojure,代码行数:17,代码来源:ClojureTemplatePanelVisual.java
示例13: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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 = "FreeMarkerProject";
}
this.projectNameTextField.setText(projectName);
this.projectNameTextField.selectAll();
}
开发者ID:rajmahendra,项目名称:NetBeans-JBake-Plugin,代码行数:17,代码来源:FreeMarkerProjectPanelVisual.java
示例14: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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 = "GroovyProject";
}
this.projectNameTextField.setText(projectName);
this.projectNameTextField.selectAll();
}
开发者ID:rajmahendra,项目名称:NetBeans-JBake-Plugin,代码行数:17,代码来源:GroovyProjectPanelVisual.java
示例15: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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 = "ThymeleafProject";
}
this.projectNameTextField.setText(projectName);
this.projectNameTextField.selectAll();
}
开发者ID:rajmahendra,项目名称:NetBeans-JBake-Plugin,代码行数:17,代码来源:ThymeleafProjectPanelVisual.java
示例16: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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 = "btraceProject";
}
this.projectNameTextField.setText(projectName);
this.projectNameTextField.selectAll();
}
开发者ID:btraceio,项目名称:btrace.nb,代码行数:17,代码来源:BtraceLibraryPanelVisual.java
示例17: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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));
}
开发者ID:AlexFalappa,项目名称:nb-springboot,代码行数:18,代码来源:InitializrProjectPanelVisual3.java
示例18: 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
示例19: readSettings
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
@Override
public void readSettings(Object settings) {
wizardDescriptor = (WizardDescriptor) settings;
File projectLocation = (File) wizardDescriptor.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) wizardDescriptor.getProperty("name");
if (projectName == null) {
projectName = "NewProject";
}
this.projectNameTextField.setText(projectName);
this.projectNameTextField.selectAll();
}
开发者ID:gholdys,项目名称:nbpio,代码行数:20,代码来源:NbpioWizardSetupStep.java
示例20: read
import org.netbeans.spi.project.ui.support.ProjectChooser; //导入依赖的package包/类
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 = "JME3TestsAndroid";
}
this.projectNameTextField.setText(projectName);
this.projectNameTextField.selectAll();
}
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:17,代码来源:JME3TestsAndroidPanelVisual.java
注:本文中的org.netbeans.spi.project.ui.support.ProjectChooser类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论