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


Java FileChooserBuilder.setTitle方法代码示例

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


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

示例1: chooseRoots

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
/**
 * Open file chooser to choose search roots.
 */
private FileObject[] chooseRoots() {
    FileChooserBuilder chooserBuilder =
            new FileChooserBuilder(SearchScopeBrowse.class);
    chooserBuilder.setTitle(UiUtils.getText(
            "LBL_ScopeBrowseFileChooserTitle"));                    //NOI18N
    chooserBuilder.setApproveText(UiUtils.getText(
            "LBL_ScopeBrowseFileChooserApprove"));                  //NOI18N
    File[] files = chooserBuilder.showMultiOpenDialog();
    if (files == null) {
        files = new File[0];
    }
    List<File> existingFiles = selectExistingFiles(files);
    FileObject[] fileObjects = new FileObject[existingFiles.size()];
    for (int i = 0; i < existingFiles.size(); i++) {
        fileObjects[i] = FileUtil.toFileObject(existingFiles.get(i));
    }
    if (fileObjects.length > 0) {
        roots = fileObjects;
    }
    return fileObjects;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:SearchScopeBrowse.java

示例2: actionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
@Override
@NbBundle.Messages("DLG_SaveToFile=Save to File")
public void actionPerformed(ActionEvent e) {
    // Save
    FileChooserBuilder fchb = new FileChooserBuilder(BigStringCustomEditor.class);
    fchb.setTitle(Bundle.DLG_SaveToFile());
    final File f = fchb.showSaveDialog();
    if (f != null) {
        new RequestProcessor(BigStringCustomEditor.class).post(new Runnable() {
            @Override
            public void run() {
                save(f);
            }
        });
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:BigStringCustomEditor.java

示例3: jButton1ActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    FileChooserBuilder builder = new FileChooserBuilder(AndroidSdkTool.class);
    builder.setTitle("Please select Android SDK Folder");
    builder.setDirectoriesOnly(true);
    File file = builder.showOpenDialog();
    if (file != null) {
        FileObject folder = FileUtil.toFileObject(file);
        if (folder.getFileObject("tools") == null) {
            Message msg = new NotifyDescriptor.Message(
                    "Not a valid SDK folder!",
                    NotifyDescriptor.ERROR_MESSAGE);
            DialogDisplayer.getDefault().notifyLater(msg);

        } else {
            String name = file.getPath();
            jTextField1.setText(name);
        }
    }
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:20,代码来源:MobilePanel.java

示例4: jButton1ActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
//        File path = new File(jTextField1.getText());
//        if (path.isDirectory()) {

        FileChooserBuilder builder = new FileChooserBuilder(this.getClass());
        builder.setDirectoriesOnly(true);
        builder.setTitle("Select Project Folder");
        File file = builder.showOpenDialog();
        if (file != null) {
            try {
                jTextField1.setText(file.getAbsolutePath() + File.separator + jTextField2.getText());
            } catch (Exception e) {
            }
        }
//        }
    }
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:17,代码来源:CreateProjectVisualPanel1.java

示例5: jButton2ActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    String pathName = jTextField1.getText();
    File path = new File(pathName);
    if (path.isDirectory()) {
        FileChooserBuilder builder = new FileChooserBuilder(getClass());
        builder.setDefaultWorkingDirectory(path);
        builder.setDirectoriesOnly(true);
        builder.setTitle("Select Assets Folder");
        File file = builder.showOpenDialog();
        if (file != null) {
            file = FileUtil.normalizeFile(file);
            try {
                jTextField2.setText(file.getAbsolutePath().substring(pathName.length(), file.getAbsolutePath().length()));
                panel.fireChangeEvent();
            } catch (Exception e) {
            }
        }
    }
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:20,代码来源:CodelessProjectWizardVisualPanel1.java

示例6: jButton5ActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
    if (loading.get()) {
        return;
    }
    loading.set(true);
    FileChooserBuilder builder = new FileChooserBuilder(this.getClass());
    builder.setTitle("Select Model File");
    final File file = builder.showOpenDialog();
    if (file != null) {
        jTextField1.setText(file.getAbsolutePath());
        new Thread(new Runnable() {

            public void run() {
                ProgressHandle handle = ProgressHandleFactory.createHandle("Opening Model..");
                handle.start();
                loadModel(file);
                handle.finish();
                loading.set(false);
            }
        }).start();
    }
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:23,代码来源:ModelImporterVisualPanel1.java

示例7: initFcb

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private static FileChooserBuilder initFcb(Class clazz, String title, List<FileFilter> extraFilters, FileFilter selectedFilter) {
    FileChooserBuilder fcb = new FileChooserBuilder(clazz==null? FileDialog.class : clazz);
    fcb.setBadgeProvider(BADGE_PROVIDER);
    
    if(title != null)
        fcb.setTitle(title);
    
    if(extraFilters != null)
        for(FileFilter filter : extraFilters)
            fcb.addFileFilter(filter);
    
    if(selectedFilter != null)
        fcb.setFileFilter(selectedFilter);
    
    return fcb;
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:17,代码来源:FileDialog.java

示例8: actionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
/** Handles button events
 */        
public void actionPerformed( ActionEvent e ) {
    
    Object source = e.getSource();
    
    if ( source == addFolderButton ) { 
        
        // Let user search for the Jar file
        FileChooserBuilder builder = new FileChooserBuilder(SourceRootsUi.class).setDirectoriesOnly(true);
        builder.setDefaultWorkingDirectory(FileUtil.toFile(this.project.getProjectDirectory()));
        String type = RootsAccessor.getInstance().getType(sourceRoots);
        boolean isModule = JavaProjectConstants.SOURCES_TYPE_MODULES.equals(type);
        if (sourceRoots.isTest()) {
            builder.setTitle(NbBundle.getMessage(SourceRootsUi.class, isModule ? "LBL_TestModuleFolder_DialogTitle" : "LBL_TestFolder_DialogTitle"));  // NOI18N
        } else {
            builder.setTitle(NbBundle.getMessage(SourceRootsUi.class, isModule ? "LBL_ModuleFolder_DialogTitle" : "LBL_SourceFolder_DialogTitle")); // NOI18N
        }
        File files[] = builder.showMultiOpenDialog();
        if ( files != null ) {
            addFolders( files );
        }
    }
    else if ( source == removeButton ) { 
        removeElements();
    }
    else if ( source == upButton ) {
        moveUp();
    }
    else if ( source == downButton ) {
        moveDown();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:SourceRootsUi.java

示例9: addJavadocActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void addJavadocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addJavadocActionPerformed
    FileChooserBuilder builder = new FileChooserBuilder(AndroidPlatformCustomizer.class);
    builder.setAcceptAllFileFilterUsed(false);
    builder.setFileFilter(new ArchiveFileFilter("javadoc files", new String[]{"JAR", "ZIP"}));
    builder.setTitle("Select Javadocs to add");
    File[] files = builder.showMultiOpenDialog();
    if (files != null) {
        for (File file : files) {
            aPackage.addJavadocPath(FileUtil.toFileObject(file).toURL(), true);
        }
        sdk.store();
        fireJavadocAdded();
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:15,代码来源:AndroidPlatformCustomizer.java

示例10: addClasspathActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void addClasspathActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addClasspathActionPerformed
    FileChooserBuilder builder = new FileChooserBuilder(AndroidPlatformCustomizer.class);
    builder.setAcceptAllFileFilterUsed(false);
    builder.setFileFilter(new ArchiveFileFilter("Jar files", new String[]{"JAR"}));
    builder.setTitle("Select ClassPath to add");
    File[] files = builder.showMultiOpenDialog();
    if (files != null) {
        for (File file : files) {
            aPackage.addBootPath(FileUtil.toFileObject(file).toURL(), true);
        }
        sdk.store();
        fireClassPathAdded();
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:15,代码来源:AndroidPlatformCustomizer.java

示例11: addSourcesActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void addSourcesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addSourcesActionPerformed
    FileChooserBuilder builder = new FileChooserBuilder(AndroidPlatformCustomizer.class);
    builder.setAcceptAllFileFilterUsed(false);
    builder.setFileFilter(new ArchiveFileFilter("src files", new String[]{"JAR", "ZIP"}));
    builder.setTitle("Select Sources to add");
    File[] files = builder.showMultiOpenDialog();
    if (files != null) {
        for (File file : files) {
            aPackage.addSrcPath(FileUtil.toFileObject(file).toURL(), true);
        }
        sdk.store();
        fireSourcesAdded();
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:15,代码来源:AndroidPlatformCustomizer.java

示例12: browseActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void browseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseActionPerformed
    // TODO add your handling code here:
    FileChooserBuilder chooserBuilder = new FileChooserBuilder(SDKVisualPanelSelect.class);
    chooserBuilder.setDirectoriesOnly(true);
    chooserBuilder.setTitle("Choose the folder where is the Android SDK installed.");
    chooserBuilder.setApproveText("OK");
    File tmp = chooserBuilder.showOpenDialog();
    if (tmp != null) {
        path.setText(tmp.getAbsolutePath());
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:12,代码来源:SDKVisualPanelSelect.java

示例13: browseActionPerformed

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
private void browseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseActionPerformed
    // TODO add your handling code here:
    FileChooserBuilder chooserBuilder = new FileChooserBuilder(SDKVisualPanelInstall.class);
    chooserBuilder.setDirectoriesOnly(true);
    chooserBuilder.setTitle("Choose the folder in which to install Android SDK Tools.");
    chooserBuilder.setApproveText("OK");
    File tmp = chooserBuilder.showOpenDialog();
    if (tmp != null) {
        path.setText(tmp.getAbsolutePath());
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:12,代码来源:SDKVisualPanelInstall.java

示例14: performAction

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
@Override
protected void performAction(Node[] activatedNodes) {
    Node node = activatedNodes[0];
    FileObject fo = node.getLookup().lookup(FileObject.class);
    if (fo != null) {
        FileChooserBuilder builder = new FileChooserBuilder(SaveAsAction.class);
        builder.setDirectoriesOnly(false);
        builder.setApproveText("Save");
        builder.setControlButtonsAreShown(true);
        builder.setTitle("Save As...");
        builder.setFilesOnly(true);
        builder.setFileFilter(new FileNameExtensionFilter(fo.getExt(), fo.getExt()));
        JFileChooser chooser = builder.createFileChooser();
        chooser.setSelectedFile(new File(fo.getNameExt()));
        int resp = chooser.showSaveDialog(findDialogParent());
        if (JFileChooser.APPROVE_OPTION == resp) {
            File saveFile = chooser.getSelectedFile();
            if (saveFile != null) {
                try {
                    saveFile.getParentFile().mkdirs();
                    FileObject dfo = FileUtil.toFileObject(saveFile.getParentFile());
                    if (dfo == null) {
                        NotifyDescriptor nd = new NotifyDescriptor.Message("Unable to Save file!", NotifyDescriptor.ERROR_MESSAGE);
                        DialogDisplayer.getDefault().notifyLater(nd);
                        return;
                    }
                    if (saveFile.exists()) {
                        saveFile.delete();
                    }
                    fo.copy(dfo, saveFile.getName(), "");
                } catch (IOException ex) {
                    Exceptions.printStackTrace(ex);
                }
            }
        }
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:38,代码来源:SaveAsAction.java

示例15: getSdkPath

import org.openide.filesystems.FileChooserBuilder; //导入方法依赖的package包/类
/**
 * Returns a String with the path to the SDK or null if none is specified.
 * @return
 */
public static String getSdkPath() {
    String path = NbPreferences.forModule(AndroidSdkTool.class).get("sdk_path", null);
    if (path == null) {
        FileChooserBuilder builder = new FileChooserBuilder(AndroidSdkTool.class);
        builder.setTitle("Please select Android SDK Folder");
        builder.setDirectoriesOnly(true);
        File file = builder.showOpenDialog();
        if (file != null) {
            FileObject folder = FileUtil.toFileObject(file);
            if (folder.getFileObject("tools") == null) {
                Message msg = new NotifyDescriptor.Message(
                        "Not a valid SDK folder!",
                        NotifyDescriptor.ERROR_MESSAGE);
                DialogDisplayer.getDefault().notifyLater(msg);

            } else {
                String name = file.getPath();
                NbPreferences.forModule(AndroidSdkTool.class).put("sdk_path", name);
                return name;
            }
        }
    } else {
        return path;
    }
    return null;
}
 
开发者ID:jMonkeyEngine,项目名称:sdk,代码行数:31,代码来源:AndroidSdkTool.java


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