Package com.lightcrafts.platform

Examples of com.lightcrafts.platform.FileChooser


        add(new JScrollPane(list));

        updateFromTemplates();

        // Import and Export need file choosers.
        final FileChooser chooser = Platform.getPlatform().getFileChooser();

        importButton = new JButton(LOCALE.get("TemplateImportButton"));
        importButton.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    Frame frame = getAncestorFrame();
                    File dir = getRecentImportDir();
                    FilenameFilter lztFilter = new FilenameFilter() {
                        public boolean accept(File file, String name) {
                            return name.toLowerCase().endsWith(".lzt");
                        }
                    };
                    File file = chooser.openFile(
                        LOCALE.get("TemplateImportDialogTitle"),
                        dir, frame, lztFilter
                    );
                    if (file != null) {
                        importTemplate(file);
                        setRecentImportDir(file.getParentFile());
                    }
                }
            }
        );
        exportButton = new JButton(LOCALE.get("TemplateExportButton"));
        exportButton.setEnabled(false);
        exportButton.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    Frame frame = getAncestorFrame();
                    File dir = getRecentExportDir();
                    File file = chooser.chooseDirectory(
                        LOCALE.get("TemplateExportDialogTitle"),
                        dir, frame, false
                    );
                    if (file != null) {
                        exportTemplates(file);
View Full Code Here


        );
        dirButton.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    Platform platform = Platform.getPlatform();
                    FileChooser chooser = platform.getFileChooser();
                    File directory = chooser.chooseDirectory(
                        LOCALE.get("SendDialogChooserTitle"),
                        conf.directory, SendDialog.this, false
                    );
                    if (directory != null) {
                        conf.directory = directory;
View Full Code Here

            }
        );
        search.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent event) {
                    FileChooser chooser = Env.getFileChooser();
                    file = chooser.openFile(
                        findTitle, chooserFile, parent,
                        ImageFilenameFilter.INSTANCE
                    );
                    if (file != null) {
                        dialog.dispose();
View Full Code Here

        );
        if (result == 0) {  // Use this image
            file = newImageFile;
        }
        else if (result == 1) { // Search for the image
            FileChooser chooser = Env.getFileChooser();
            String title = LOCALE.get(
                "ImageSelectorFindDialogTitle", oldImageFile.getName()
            );
            file = chooser.openFile(
                title, chooserFile, parent, ImageFilenameFilter.INSTANCE
            );
        }
        else {
            file = null;    // Cancel
View Full Code Here

            AlertDialog.ERROR_ALERT,
            LOCALE.get("ImageSelectorSearchOption"),
            LOCALE.get("ImageSelectorCancelOption")
        );
        if (result == 0) {  // Yes, please search
            FileChooser chooser = Env.getFileChooser();
            String title = LOCALE.get(
                "ImageSelectorFindDialogTitle", oldImageFile.getName()
            );
            file = chooser.openFile(
                title, chooserFile, parent, ImageFilenameFilter.INSTANCE
            );
        }
        else {
            file = null;    // Cancel
View Full Code Here

        );
        dirButton.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    Platform platform = Platform.getPlatform();
                    FileChooser chooser = platform.getFileChooser();
                    File directory = chooser.chooseDirectory(
                        LOCALE.get("BatchConfOutputChooserDialogTitle"),
                        config.directory, dialog, false
                    );
                    if (directory != null) {
                        config.directory = directory;
View Full Code Here

        }
    }

    // Conduct the dialog to accept a new color profile.
    public void actionPerformed(ActionEvent event) {
        FileChooser chooser = Platform.getPlatform().getFileChooser();
        AlertDialog alert = Platform.getPlatform().getAlertDialog();
        String path;
        if (text.isEnabled()) {
            path = text.getText();
        }
        else {
            path = System.getProperty("user.home");
        }
        File file = new File(path);
        file = chooser.openFile(
            "Display Color Profile", file, null, null
        );
        if (file != null) {
            if (! file.isFile()) {
                alert.showAlert(
View Full Code Here

        chooserButton.setToolTipText(LOCALE.get("ScratchFileItemToolTip"));

        chooserButton.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent event) {
                    FileChooser chooser =
                        Platform.getPlatform().getFileChooser();
                    String path = text.getText();
                    File dir = new File(path);
                    Window window = (Window) SwingUtilities.getAncestorOfClass(
                        Window.class, chooserButton
                    );
                    dir = chooser.chooseDirectory(
                        LOCALE.get("ScratchFileDialogTitle"), dir, window, true
                    );
                    if (dir != null) {
                        if (! dir.isDirectory()) {
                            dir = dir.getParentFile();
View Full Code Here

TOP

Related Classes of com.lightcrafts.platform.FileChooser

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.