Example usage for javax.swing JFileChooser JFileChooser

List of usage examples for javax.swing JFileChooser JFileChooser

Introduction

In this page you can find the example usage for javax.swing JFileChooser JFileChooser.

Prototype

public JFileChooser() 

Source Link

Document

Constructs a JFileChooser pointing to the user's default directory.

Usage

From source file:eu.novait.imagerenamer.gui.MainWindow.java

protected void addFilesToList() {
    if (chooser == null) {
        chooser = new JFileChooser();
    }/*from  w w w.j  a  v a  2 s  . co  m*/
    chooser.addChoosableFileFilter(new ImageFileFilter());
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    chooser.setMultiSelectionEnabled(true);
    chooser.setAcceptAllFileFilterUsed(false);
    int returnVal = chooser.showSaveDialog(this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        this.setCurrentState(STATE_LOADING);
        Thread addThread = new Thread(new Runnable() {

            @Override
            public void run() {
                File[] selectedFiles = chooser.getSelectedFiles();
                loaderBar.setMaximum(selectedFiles.length);
                loaderBar.setValue(0);
                for (File f : selectedFiles) {
                    ImageFile imageFile = new ImageFile(f.getAbsolutePath());
                    imageTableModel.addImageToList(imageFile);
                    loaderBar.setValue(loaderBar.getValue() + 1);
                }
                imageTableModel.markAsChanged();
                setCurrentState(STATE_WAITING);
            }
        });
        addThread.start();
    }
}

From source file:edu.harvard.mcz.imagecapture.jobs.JobCleanDirectory.java

private List<File> getFileList() {
    ArrayList<File> files = new ArrayList<File>();
    String pathToCheck = "";
    // Find the path in which to include files.
    File imagebase = null; // place to start the scan from, imagebase directory for SCAN_ALL
    File startPoint = null;//from   w ww .  j a  v a  2  s . com
    // If it isn't null, retrieve the image base directory from properties, and test for read access.
    if (Singleton.getSingletonInstance().getProperties().getProperties()
            .getProperty(ImageCaptureProperties.KEY_IMAGEBASE) == null) {
        JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                "Can't start scan.  Don't know where images are stored.  Set imagbase property.", "Can't Scan.",
                JOptionPane.ERROR_MESSAGE);
    } else {
        imagebase = new File(Singleton.getSingletonInstance().getProperties().getProperties()
                .getProperty(ImageCaptureProperties.KEY_IMAGEBASE));
        if (imagebase != null) {
            if (imagebase.canRead()) {
                startPoint = imagebase;
            } else {
                // If it can't be read, null out imagebase
                imagebase = null;
            }
        }
        if (scan == SCAN_SPECIFIC && startPointSpecific != null && startPointSpecific.canRead()) {
            // A scan start point has been provided, don't launch a dialog.
            startPoint = startPointSpecific;
        }
        if (imagebase == null || scan == SCAN_SELECT) {
            // launch a file chooser dialog to select the directory to scan
            final JFileChooser fileChooser = new JFileChooser();
            fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            if (scan == SCAN_SELECT && startPointSpecific != null && startPointSpecific.canRead()) {
                fileChooser.setCurrentDirectory(startPointSpecific);
            } else {
                if (Singleton.getSingletonInstance().getProperties().getProperties()
                        .getProperty(ImageCaptureProperties.KEY_LASTPATH) != null) {
                    fileChooser.setCurrentDirectory(new File(Singleton.getSingletonInstance().getProperties()
                            .getProperties().getProperty(ImageCaptureProperties.KEY_LASTPATH)));
                }
            }
            int returnValue = fileChooser.showOpenDialog(Singleton.getSingletonInstance().getMainFrame());
            if (returnValue == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                log.debug("Selected base directory: " + file.getName() + ".");
                startPoint = file;
            } else {
                //TODO: handle error condition
                log.error("Directory selection cancelled by user.");
            }
        }

        // Check that startPoint is or is within imagebase.
        if (!ImageCaptureProperties.isInPathBelowBase(startPoint)) {
            String base = Singleton.getSingletonInstance().getProperties().getProperties()
                    .getProperty(ImageCaptureProperties.KEY_IMAGEBASE);
            log.error("Tried to scan directory (" + startPoint.getPath() + ") outside of base image directory ("
                    + base + ")");
            String message = "Can't scan and cleanup files outside of base image directory (" + base + ")";
            JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(), message,
                    "Can't Scan outside image base directory.", JOptionPane.YES_NO_OPTION);
        } else if (ImageCaptureProperties.getPathBelowBase(startPoint).trim().length() == 0) {
            String base = Singleton.getSingletonInstance().getProperties().getProperties()
                    .getProperty(ImageCaptureProperties.KEY_IMAGEBASE);
            log.error("Tried to scan directory (" + startPoint.getPath()
                    + ") which is the base image directory.");
            String message = "Can only scan and cleanup files in a selected directory within the base directory  ("
                    + base + ").\nYou must select some subdirectory within the base directory to cleanup.";
            JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(), message,
                    "Can't Cleanup image base directory.", JOptionPane.YES_NO_OPTION);

        } else {
            if (!startPoint.canRead()) {
                JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                        "Can't start scan.  Unable to read selected directory: " + startPoint.getPath(),
                        "Can't Scan.", JOptionPane.YES_NO_OPTION);
            } else {
                pathToCheck = ImageCaptureProperties.getPathBelowBase(startPoint);

                // retrieve a list of image records in the selected directory
                ICImageLifeCycle ils = new ICImageLifeCycle();
                List<ICImage> images = ils.findAllInDir(pathToCheck);
                Iterator<ICImage> iter = images.iterator();
                while (iter.hasNext()) {
                    ICImage image = iter.next();
                    File imageFile = new File(
                            ImageCaptureProperties.assemblePathWithBase(image.getPath(), image.getFilename()));
                    files.add(imageFile);
                    counter.incrementFilesSeen();
                }

            }
        }
    }

    log.debug("Found " + files.size() + " Image files in directory to check.");

    return files;
}

From source file:utilities.GraphViewer.java

public void actionPerformed(ActionEvent e) {
    // Evenement button parcourir
    if (e.getSource() == this.parcourir) {

        JFileChooser fileopen = new JFileChooser();
        FiltreSimple filter = new FiltreSimple("Fichier res", "res");
        fileopen.addChoosableFileFilter(filter);
        int ret = fileopen.showDialog(null, "Open file");
        if (ret == JFileChooser.APPROVE_OPTION) {
            File file = fileopen.getSelectedFile();
            System.out.println(file.getPath());
            this.addSensor(file.getPath());

        }//from  w  w  w.java 2 s .c  o  m

    } else {

        JCheckBox check;
        for (int i = 0; i < this.sensors.size(); i++) {
            check = sensors.get(i);
            if (e.getSource() == check) {
                if (check.isSelected()) {
                    if (!this.isExist(check)) {
                        String s = check.getText();
                        s = s.substring(1);
                        ajouterFichier(this.db.getPath(check.getText()));
                        sensors1.addLast(check);
                        this.graphe.revalidate();
                    }

                } else {
                    this.removeSerie(check.getText());
                    sensors1.remove(check);
                    this.graphe.revalidate();

                }
                break;
            }
        }

    }

}

From source file:com.reelfx.controller.AbstractController.java

public void askForAndSaveRecording() {
    JFileChooser fileSelect = new JFileChooser();
    int returnVal = fileSelect.showSaveDialog(null);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = fileSelect.getSelectedFile();
        saveRecording(file);//from   w ww . j a  v a  2s  .c o m
    }
}

From source file:com.jtk.medicalrecord.view.panel.InputMedrecPemeriksaanpendukung.java

private void btnTambahActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTambahActionPerformed
    if (view) {/*  ww  w.  ja  v  a 2 s  .  c o m*/
        download();
    } else {
        JFileChooser fileChooser = new JFileChooser();
        int result = fileChooser.showOpenDialog(null);
        if (result == JFileChooser.APPROVE_OPTION) {
            String url = fileChooser.getSelectedFile().getAbsolutePath();
            try {
                InputStream is = new FileInputStream(new File(url));
                String tipeFile = FilenameUtils.getExtension(url);
                String namaFile = FilenameUtils.getBaseName(url);

                PemeriksaanPendukung pp = new PemeriksaanPendukung();
                pp.setPemId(UUID.randomUUID().toString().replace("-", ""));
                pp.setPemNmFile(namaFile);
                pp.setPemTipeFile(tipeFile);
                pp.setPemFile(IOUtils.toByteArray(is));

                pemeriksaanPendukungs.add(pp);

                createTableValue();
            } catch (FileNotFoundException ex) {
                MessageHelper.addErrorMessage("Error add file", ex.getMessage());
                Logger.getLogger(InputMedrecPemeriksaanpendukung.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IOException ex) {
                MessageHelper.addErrorMessage("Error add file", ex.getMessage());
                Logger.getLogger(InputMedrecPemeriksaanpendukung.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
}

From source file:edu.harvard.mcz.imagecapture.jobs.JobRecheckForTemplates.java

private List<ICImage> getFileList() {
    List<ICImage> files = new ArrayList<ICImage>();
    if (scan != SCAN_ALL) {
        String pathToCheck = "";
        // Find the path in which to include files.
        File imagebase = null; // place to start the scan from, imagebase directory for SCAN_ALL
        File startPoint = null;//from   www  .ja  v a 2  s . co m
        // If it isn't null, retrieve the image base directory from properties, and test for read access.
        if (Singleton.getSingletonInstance().getProperties().getProperties()
                .getProperty(ImageCaptureProperties.KEY_IMAGEBASE) == null) {
            JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                    "Can't start scan.  Don't know where images are stored.  Set imagbase property.",
                    "Can't Scan.", JOptionPane.ERROR_MESSAGE);
        } else {
            imagebase = new File(Singleton.getSingletonInstance().getProperties().getProperties()
                    .getProperty(ImageCaptureProperties.KEY_IMAGEBASE));
            if (imagebase != null) {
                if (imagebase.canRead()) {
                    startPoint = imagebase;
                } else {
                    // If it can't be read, null out imagebase
                    imagebase = null;
                }
            }
            if (scan == SCAN_SPECIFIC && startPointSpecific != null && startPointSpecific.canRead()) {
                // A scan start point has been provided, don't launch a dialog.
                startPoint = startPointSpecific;
            }
            if (imagebase == null || scan == SCAN_SELECT) {
                // launch a file chooser dialog to select the directory to scan
                final JFileChooser fileChooser = new JFileChooser();
                fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
                if (scan == SCAN_SELECT && startPointSpecific != null && startPointSpecific.canRead()) {
                    fileChooser.setCurrentDirectory(startPointSpecific);
                } else {
                    if (Singleton.getSingletonInstance().getProperties().getProperties()
                            .getProperty(ImageCaptureProperties.KEY_LASTPATH) != null) {
                        fileChooser
                                .setCurrentDirectory(new File(Singleton.getSingletonInstance().getProperties()
                                        .getProperties().getProperty(ImageCaptureProperties.KEY_LASTPATH)));
                    }
                }
                int returnValue = fileChooser.showOpenDialog(Singleton.getSingletonInstance().getMainFrame());
                if (returnValue == JFileChooser.APPROVE_OPTION) {
                    File file = fileChooser.getSelectedFile();
                    log.debug("Selected base directory: " + file.getName() + ".");
                    startPoint = file;
                } else {
                    //TODO: handle error condition
                    log.error("Directory selection cancelled by user.");
                }
            }

            // Check that startPoint is or is within imagebase.
            if (!ImageCaptureProperties.isInPathBelowBase(startPoint)) {
                String base = Singleton.getSingletonInstance().getProperties().getProperties()
                        .getProperty(ImageCaptureProperties.KEY_IMAGEBASE);
                log.error("Tried to scan directory (" + startPoint.getPath()
                        + ") outside of base image directory (" + base + ")");
                String message = "Can't scan and database files outside of base image directory (" + base + ")";
                JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(), message,
                        "Can't Scan outside image base directory.", JOptionPane.YES_NO_OPTION);
            } else {
                if (!startPoint.canRead()) {
                    JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(),
                            "Can't start scan.  Unable to read selected directory: " + startPoint.getPath(),
                            "Can't Scan.", JOptionPane.YES_NO_OPTION);
                } else {
                    pathToCheck = ImageCaptureProperties.getPathBelowBase(startPoint);

                    // retrieve a list of image records in the selected directory
                    ICImageLifeCycle ils = new ICImageLifeCycle();
                    ICImage pattern = new ICImage();
                    pattern.setPath(pathToCheck);
                    pattern.setTemplateId(PositionTemplate.TEMPLATE_NO_COMPONENT_PARTS);
                    files = ils.findByExample(pattern);
                    if (files != null) {
                        log.debug(files.size());
                    }
                }
            }
        }
    } else {
        try {
            // retrieve a list of all image records with no template
            ICImageLifeCycle ils = new ICImageLifeCycle();
            files = ils.findNotDrawerNoTemplateImages();
            if (files != null) {
                log.debug(files.size());
            }
        } catch (HibernateException e) {
            log.error(e.getMessage());
            runStatus = RunStatus.STATUS_FAILED;
            String message = "Error loading the list of images with no templates. " + e.getMessage();
            JOptionPane.showMessageDialog(Singleton.getSingletonInstance().getMainFrame(), message,
                    "Error loading image records.", JOptionPane.YES_NO_OPTION);
        }
    }

    log.debug("Found " + files.size() + " Image files without templates in directory to check.");

    return files;
}

From source file:edu.uchc.octane.OctanePlugin.java

@Override
public void run(String cmd) {

    if (!IJ.isJava16()) {

        IJ.error("Octane requires Java version 1.6 or higher. Please upgrade the JVM.");
        return;//from   w ww .  ja va  2s  . c o  m

    }

    try {

        Class.forName("org.apache.commons.math3.util.FastMath");

    } catch (ClassNotFoundException e) {

        IJ.error("This version of Octane requires Apache Commons Math v3.0 or later. Please install.");
        return;
    }

    imp_ = WindowManager.getCurrentImage();

    if (imp_ == null || imp_.getStack().getSize() < 2) {

        IJ.error("This only works on an opened image stack.");
        return;

    }

    FileInfo fi = imp_.getOriginalFileInfo();
    String path;

    if (fi != null) {

        path = fi.directory;

    } else {

        IJ.error("Can't find image's disk location. You must save the data on disk first.");
        return;

    }

    if (dict_.containsKey(imp_)) { // window already open

        OctanePlugin plugin = dict_.get(imp_);

        if (plugin != null && cmd.equals("load")) {

            plugin.ctl_.getWindow().setVisible(true);
            return;

        } else {

            // do nothing

        }
    }

    if (cmd.startsWith("analyze")) {

        if (startImageAnalysis(cmd)) { // wasOked?

            SmNode[][] nodes = dlg_.processAllFrames();

            if (TrackingParameters.openDialog(dlg_.pixelSize_)) { //wasOKed ?

                TrajDataset data = TrajDataset.createDatasetFromNodes(nodes);
                data.setPixelSize(dlg_.pixelSize_);

                ctl_ = new OctaneWindowControl(imp_);

                String filename = ctl_.defaultSaveFilename();
                File file = new File(filename);

                if (file.exists()) {

                    int idx = 1;
                    File newFile;

                    do {

                        String backupName = filename + ".b" + idx;
                        newFile = new File(backupName);

                        idx++;

                    } while (newFile.exists());

                    if (!file.renameTo(newFile)) {

                        IJ.error("Problem renaming old dataset file");
                        return;

                    }

                }

                openWindow(data);

                ctl_.saveDataset();

                return;
            }
        }

        dict_.remove(imp_);
    }

    if (cmd.startsWith("calibration")) {

        startImageAnalysis(cmd);
        dict_.remove(imp_);

    }

    if (cmd.equals("load")) {

        assert (path != null);

        File file = new File(path + File.separator + imp_.getTitle() + ".dataset");

        if (file.exists()) {

            try {

                ctl_ = new OctaneWindowControl(imp_);

                openWindow(readDataset(file));

            } catch (IOException e) {

                IJ.error("An IO error occured reading file: " + file.getName() + "\n "
                        + e.getLocalizedMessage());

            } catch (ClassNotFoundException e) {

                IJ.error("Can't recognize the file format: " + file.getName() + "\n" + e.getLocalizedMessage());

            }
        } else {

            IJ.error("Can't find previous analysis results."
                    + " It needs to be saved in the same folder as your image data.");

        }

        return;

    }

    if (cmd.equals("import")) {

        JFileChooser fc = new JFileChooser();

        if (fc.showOpenDialog(IJ.getApplet()) == JFileChooser.APPROVE_OPTION) {
            try {

                ctl_ = new OctaneWindowControl(imp_);

                openWindow(TrajDataset.importDatasetFromText(fc.getSelectedFile()));

                ctl_.saveDataset();

            } catch (IOException e) {

                IJ.error("An IO error occured reading file: " + fc.getSelectedFile().getName());
                return;
            }
        }

        return;
    }
}

From source file:io.heming.accountbook.ui.MainFrame.java

private void importRecords() {
    final JFileChooser chooser = new JFileChooser();
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    chooser.addChoosableFileFilter(new AbbFileFilter());
    chooser.setAcceptAllFileFilterUsed(false);
    int value = chooser.showOpenDialog(this);
    if (value == JFileChooser.APPROVE_OPTION) {
        // ?/*from  w  ww .j a va  2s .  c  om*/
        disableAllControls();
        new Thread() {
            @Override
            public void run() {
                try {
                    statusLabel.setIcon(new ImageIcon(getClass().getResource("loader.gif")));
                    setStatusText("?...");
                    FacadeUtil.shutdown();
                    File file = chooser.getSelectedFile();
                    setStatusText("??...");
                    FileUtils.cleanDirectory(new File(Constants.DATA_DIR));
                    setStatusText("??...");
                    ZIPUtil.decompress(file, new File(Constants.HOME_DIR));
                    setStatusText("?...");
                    FacadeUtil.restart();
                    // ??
                    setStatusText("????...");
                    categories = categoryFacade.listBySale();
                    // ????
                    setStatusText("?...");
                    searchRecords();
                    enableAllControls();
                    setStatusText("");
                    statusLabel.setIcon(new ImageIcon(getClass().getResource("stopped-loader.png")));
                    JOptionPane.showMessageDialog(MainFrame.this, "???", "?",
                            JOptionPane.INFORMATION_MESSAGE);
                } catch (Exception e) {
                    JOptionPane.showMessageDialog(MainFrame.this, e.getMessage(), "",
                            JOptionPane.ERROR_MESSAGE);
                }
            }
        }.start();
    }
}

From source file:de.uka.ilkd.key.dl.gui.initialdialog.gui.ToolInstaller.java

public void install(JComponent parent, Window dialog) {

    final File installDirectory;
    switch (OSInfosDefault.INSTANCE.getOs()) {
    case OSX://www. j  av  a  2 s  .  c  o  m
        System.setProperty("apple.awt.fileDialogForDirectories", "true");
        FileDialog d = new FileDialog(Frame.getFrames()[0], "Choose directory for installation of " + toolName,
                FileDialog.LOAD);
        d.setVisible(true);
        System.setProperty("apple.awt.fileDialogForDirectories", "false");
        if (d.getFile() != null) {
            installDirectory = new File(d.getDirectory(), d.getFile());
        } else {
            installDirectory = null;
        }
        break;
    default:
        final JFileChooser chooser = new JFileChooser();
        chooser.setMultiSelectionEnabled(false);
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        chooser.setDialogTitle("Choose directory for installation of " + toolName);
        chooser.setDialogType(JFileChooser.SAVE_DIALOG);
        chooser.setApproveButtonText("Install " + toolName + " here");
        int result = chooser.showDialog(parent, "Install " + toolName + " here");
        if (result == JFileChooser.APPROVE_OPTION) {
            installDirectory = chooser.getSelectedFile();
        } else {
            installDirectory = null;
        }
    }

    if (installDirectory != null) {
        try {
            final File tmp = File.createTempFile("keymaeraDownload", "." + ft.toString().toLowerCase());
            final FileInfo info = new FileInfo(url, tmp.getName(), false);
            final DownloadManager dlm = new DownloadManager();
            ProgressBarWindow pbw = new ProgressBarWindow(parent, installDirectory, tmp, ft, ps, dialog);
            dlm.addListener(pbw);
            Runnable down = new Runnable() {

                @Override
                public void run() {
                    dlm.downloadAll(new FileInfo[] { info }, 2000, tmp.getParentFile().getAbsolutePath(), true);
                }
            };
            Thread thread = new Thread(down);
            thread.start();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
}

From source file:be.fedict.eid.tsl.tool.TslTool.java

@Override
public void actionPerformed(ActionEvent event) {
    String command = event.getActionCommand();
    if (EXIT_ACTION_COMMAND.equals(command)) {
        System.exit(0);/*w  ww  .j av a 2  s  .c  o  m*/
    } else if (OPEN_ACTION_COMMAND.equals(command)) {
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setDialogTitle("Open TSL");
        int returnValue = fileChooser.showOpenDialog(this);
        if (returnValue == JFileChooser.APPROVE_OPTION) {
            displayTsl(fileChooser.getSelectedFile());
        }
    } else if (ABOUT_ACTION_COMMAND.equals(command)) {
        JOptionPane.showMessageDialog(this,
                "eID TSL Tool\n" + "Copyright (C) 2009-2013 FedICT\n" + "http://code.google.com/p/eid-tsl/",
                "About", JOptionPane.INFORMATION_MESSAGE);
    } else if (CLOSE_ACTION_COMMAND.equals(command)) {
        if (this.activeTslInternalFrame.getTrustServiceList().hasChanged()) {
            int result = JOptionPane.showConfirmDialog(this, "TSL has been changed.\n" + "Save the TSL?",
                    "Save", JOptionPane.YES_NO_CANCEL_OPTION);
            if (JOptionPane.CANCEL_OPTION == result) {
                return;
            }
            if (JOptionPane.YES_OPTION == result) {
                try {
                    this.activeTslInternalFrame.save();
                } catch (IOException e) {
                    LOG.error("IO error: " + e.getMessage(), e);
                }
            }
        }
        try {
            this.activeTslInternalFrame.setClosed(true);
        } catch (PropertyVetoException e) {
            LOG.warn("property veto error: " + e.getMessage(), e);
        }
    } else if (SIGN_ACTION_COMMAND.equals(command)) {
        LOG.debug("sign");
        TrustServiceList trustServiceList = this.activeTslInternalFrame.getTrustServiceList();
        if (trustServiceList.hasSignature()) {
            int confirmResult = JOptionPane.showConfirmDialog(this,
                    "TSL is already signed.\n" + "Resign the TSL?", "Resign", JOptionPane.OK_CANCEL_OPTION);
            if (JOptionPane.CANCEL_OPTION == confirmResult) {
                return;
            }
        }
        SignSelectPkcs11FinishablePanel pkcs11Panel = new SignSelectPkcs11FinishablePanel();
        WizardDescriptor wizardDescriptor = new WizardDescriptor(
                new WizardDescriptor.Panel[] { new SignInitFinishablePanel(), pkcs11Panel,
                        new SignSelectCertificatePanel(pkcs11Panel, trustServiceList),
                        new SignFinishFinishablePanel() });
        wizardDescriptor.setTitle("Sign TSL");
        wizardDescriptor.putProperty("WizardPanel_autoWizardStyle", Boolean.TRUE);
        DialogDisplayer dialogDisplayer = DialogDisplayer.getDefault();
        Dialog wizardDialog = dialogDisplayer.createDialog(wizardDescriptor);
        wizardDialog.setVisible(true);
    } else if (SAVE_ACTION_COMMAND.equals(command)) {
        LOG.debug("save");
        try {
            this.activeTslInternalFrame.save();
            this.saveMenuItem.setEnabled(false);
        } catch (IOException e) {
            LOG.debug("IO error: " + e.getMessage(), e);
        }
    } else if (SAVE_AS_ACTION_COMMAND.equals(command)) {
        LOG.debug("save as");
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setDialogTitle("Save As");
        int result = fileChooser.showSaveDialog(this);
        if (JFileChooser.APPROVE_OPTION == result) {
            File tslFile = fileChooser.getSelectedFile();
            if (tslFile.exists()) {
                int confirmResult = JOptionPane.showConfirmDialog(this,
                        "File already exists.\n" + tslFile.getAbsolutePath() + "\n" + "Overwrite file?",
                        "Overwrite", JOptionPane.OK_CANCEL_OPTION);
                if (JOptionPane.CANCEL_OPTION == confirmResult) {
                    return;
                }
            }
            try {
                this.activeTslInternalFrame.saveAs(tslFile);
            } catch (IOException e) {
                LOG.debug("IO error: " + e.getMessage(), e);
            }
            this.saveMenuItem.setEnabled(false);
        }
    } else if (EXPORT_ACTION_COMMAND.equals(command)) {
        LOG.debug("export");
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.setDialogTitle("Export to PDF");
        int result = fileChooser.showSaveDialog(this);
        if (JFileChooser.APPROVE_OPTION == result) {
            File pdfFile = fileChooser.getSelectedFile();
            if (pdfFile.exists()) {
                int confirmResult = JOptionPane.showConfirmDialog(this,
                        "File already exists.\n" + pdfFile.getAbsolutePath() + "\n" + "Overwrite file?",
                        "Overwrite", JOptionPane.OK_CANCEL_OPTION);
                if (JOptionPane.CANCEL_OPTION == confirmResult) {
                    return;
                }
            }
            try {
                this.activeTslInternalFrame.export(pdfFile);
            } catch (IOException e) {
                LOG.debug("IO error: " + e.getMessage(), e);
            }
        }
    } else if ("TSL-BE-2010-T1".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2010, Trimester.FIRST);
        displayTsl("*TSL-BE-2010-T1.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2010-T2".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2010, Trimester.SECOND);
        displayTsl("*TSL-BE-2010-T2.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2010-T3".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2010, Trimester.THIRD);
        displayTsl("*TSL-BE-2010-T3.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2011-T1".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2011, Trimester.FIRST);
        displayTsl("*TSL-BE-2011-T1.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2011-T2".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2011, Trimester.SECOND);
        displayTsl("*TSL-BE-2011-T2.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2011-T3".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2011, Trimester.THIRD);
        displayTsl("*TSL-BE-2011-T3.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2012-T1".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2012, Trimester.FIRST);
        displayTsl("*TSL-BE-2012-T1.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2012-T2".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2012, Trimester.SECOND);
        displayTsl("*TSL-BE-2012-T2.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2012-T3".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2012, Trimester.THIRD);
        displayTsl("*TSL-BE-2012-T3.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2013-T1".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2013, Trimester.FIRST);
        displayTsl("*TSL-BE-2013-T1.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2013-T2".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2013, Trimester.SECOND);
        displayTsl("*TSL-BE-2013-T2.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2013-T3".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2013, Trimester.THIRD);
        displayTsl("*TSL-BE-2013-T3.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2014-T1".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2014, Trimester.FIRST);
        displayTsl("*TSL-BE-2014-T1.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2014-T2".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2014, Trimester.SECOND);
        displayTsl("*TSL-BE-2014-T2.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2014-T3".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2014, Trimester.THIRD);
        displayTsl("*TSL-BE-2014-T3.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2015-T1".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2015, Trimester.FIRST);
        displayTsl("*TSL-BE-2015-T1.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2015-T2".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2015, Trimester.SECOND);
        displayTsl("*TSL-BE-2015-T2.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    } else if ("TSL-BE-2015-T3".equals(command)) {
        TrustServiceList trustServiceList = BelgianTrustServiceListFactory.newInstance(2015, Trimester.THIRD);
        displayTsl("*TSL-BE-2015-T3.xml", trustServiceList);
        this.saveMenuItem.setEnabled(false);
    }
}