Package org.openquark.util.ui

Examples of org.openquark.util.ui.ExtensionFileFilter


     * Handle a press on the Browse button by opening a file dialog
     */
    protected void onBrowse () {
        JFileChooser fileChooser = new JFileChooser (getFilenameField().getText());
       
        fileChooser.setFileFilter(new ExtensionFileFilter ("txt", "Text Files"));
       
        if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            String filename = fileChooser.getSelectedFile().getPath();
           
            getFilenameField().setText(filename);
View Full Code Here


            return;
        }

        JFileChooser fileChooser = new JFileChooser ();

        fileChooser.addChoosableFileFilter (new ExtensionFileFilter ("bam", "Monitor document"));

        if (fileChooser.showOpenDialog (this) == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile ();

            MonitorDocument document = MonitorDocument.Load (file);
View Full Code Here

        String pathname = document.getPathname ();

        JFileChooser fileChooser = new JFileChooser (pathname);

        fileChooser.addChoosableFileFilter (new ExtensionFileFilter ("bam", "Monitor document"));

        if (fileChooser.showSaveDialog (this) == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile ();

            document.save (file);
View Full Code Here

    /**
     * Get the default filechooser file filter for workspace files.
     * @return FileFilter a file filter for workspace files.
     */
    public static FileFilter getDefaultFileFilter() {
        return new ExtensionFileFilter("cws", "Workspace files");
    }
View Full Code Here

                JFileChooser fileChooser = new JFileChooser(getFileBasedDeclarationFileName());
                fileChooser.setDialogTitle(GemCutter.getResourceString("SwitchWorkspaceSelectDeclarationFile"));
                fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
               
                // Set up other customizations
                FileFilter filter = new ExtensionFileFilter(WorkspaceDeclarationPathMapper.INSTANCE.getFileExtension(), GemCutter.getResourceString("CWSFilesFilterName"));
             
                fileChooser.setAcceptAllFileFilterUsed(true);
                fileChooser.addChoosableFileFilter(filter);
                fileChooser.setFileFilter(filter);           
               
View Full Code Here

                } else {
                    // Set the file selection mode.
                    fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                   
                    // Set a custom file filter.
                    fileChooser.setFileFilter(new ExtensionFileFilter("jar", GeneratorMessages.getString("JFIMF_Chooser_ImportJarFilterDescription")));
                }
               
                // Customize the add button text.
                String buttonText = GeneratorMessages.getString(
                        chooseDir ? (currentFile == null ? "JFIMF_Chooser_AddImportFolder" : "JFIMF_Chooser_ChangeImportFolder") :
View Full Code Here

     * Handle the situation where the user has indicated that they would like to add a module to the current workspace
     *   using a simple .cal source file.
     */
    private void handleAddModuleFromSourceFileAction() {

        FileFilter fileFilter = new ExtensionFileFilter(CALSourcePathMapper.INSTANCE.getFileExtension(), getResourceString("CALFileDescription"));

        String initialDir = getPreferences().get(ADD_MODULE_DIRECTORY_PREF_KEY, ADD_MODULE_DIRECTORY_DEFAULT);
       
        JFileChooser fileChooser = new JFileChooser(initialDir);
        fileChooser.setFileFilter(fileFilter);
View Full Code Here

        // Create the file chooser at a default initial directory.
        String initialDir = getPreferences().get(EXPORT_MODULE_DIRECTORY_PREF_KEY, ADD_MODULE_DIRECTORY_DEFAULT);
        JFileChooser fileChooser = new JFileChooser(initialDir);
       
        // Create and set the file filter.
        FileFilter fileFilter = new ExtensionFileFilter(JAR_FILE_EXTENSION, getResourceString("JarFiles"));

        fileChooser.setFileFilter(fileFilter);

        // Also accept the accept all filter.
        fileChooser.setAcceptAllFileFilterUsed(true);
View Full Code Here

                getGemBrowser().getBrowserTree().selectGemNode(gemEntity);
            }
        } else {
           
            // Display a dialog for the user to pick a design to load.
            FileFilter fileFilter = new ExtensionFileFilter(XMLPersistenceConstants.XML_FILE_EXTENSION, getResourceString("OpenDesign_FileDescription"));
       
            String initialDir = getPreferences().get(OPEN_DESIGN_DIRECTORY_PREF_KEY, OPEN_DESIGN_DIRECTORY_DEFAULT);
           
            JFileChooser fileChooser = new JFileChooser(initialDir);
            fileChooser.setFileFilter(fileFilter);
View Full Code Here

            excludeFunctionsField.setEditable(true);
            excludeFunctionsField.getEditor().setItem(getPreferences().get(EXCLUDE_FUNCTIONS_BY_REGEXP_ARGUMENT_PREF_KEY, EXCLUDE_FUNCTIONS_BY_REGEXP_ARGUMENT_DEFAULT));
            excludeFunctionsField.setEnabled(shouldExcludeFunctionsByRegexp());
           
            // Set up other customizations
            final FileFilter filter = new ExtensionFileFilter("csv", getResourceString("CSVFileFilterName"));
         
            setAcceptAllFileFilterUsed(true);
            addChoosableFileFilter(filter);
            setFileFilter(filter);           
        }
View Full Code Here

TOP

Related Classes of org.openquark.util.ui.ExtensionFileFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.