Example usage for javax.swing JOptionPane YES_OPTION

List of usage examples for javax.swing JOptionPane YES_OPTION

Introduction

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

Prototype

int YES_OPTION

To view the source code for javax.swing JOptionPane YES_OPTION.

Click Source Link

Document

Return value from class method if YES is chosen.

Usage

From source file:de.evaluationtool.gui.EvaluationFrameActionListener.java

private void saveReferenceXML() {
    JFileChooser chooser = new JFileChooser(
            "Save as alignment xml format. YOUR EVALUATION WILL NOT BE SAVED, ONLY A COPY OF THE INPUT.");
    chooser.setCurrentDirectory(new File("."));
    int returnVal = chooser.showSaveDialog(frame);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        if (chooser.getSelectedFile().exists() && (JOptionPane.showConfirmDialog(frame,
                "File already exists. Overwrite?") != JOptionPane.YES_OPTION)) {
            return;
        }//from   w  w  w  . j  a  v  a  2  s.c o  m
        frame.saveReferenceXML(chooser.getSelectedFile(), true);
    }
}

From source file:com.igormaznitsa.zxpspritecorrector.files.TAPPlugin.java

@Override
public void writeTo(final File file, final ZXPolyData data, final SessionData session) throws IOException {
    final int saveAsSeparateFiles = JOptionPane.showConfirmDialog(this.mainFrame,
            "Save each block as a separated file?", "Separate files", JOptionPane.YES_NO_CANCEL_OPTION);
    if (saveAsSeparateFiles == JOptionPane.CANCEL_OPTION)
        return;//from www.  jav  a 2  s. c  o m

    final String baseName = file.getName();
    final String baseZXName = FilenameUtils.getBaseName(baseName);
    if (saveAsSeparateFiles == JOptionPane.YES_OPTION) {

        final FileNameDialog fileNameDialog = new FileNameDialog(this.mainFrame, "Saving as separated files",
                new String[] { addNumberToFileName(baseName, 0), addNumberToFileName(baseName, 1),
                        addNumberToFileName(baseName, 2), addNumberToFileName(baseName, 3) },
                new String[] { prepareNameForTAP(baseZXName, 0), prepareNameForTAP(baseZXName, 1),
                        prepareNameForTAP(baseZXName, 2), prepareNameForTAP(baseZXName, 3) },
                null);
        fileNameDialog.setVisible(true);
        if (fileNameDialog.approved()) {
            final String[] fileNames = fileNameDialog.getFileName();
            final String[] zxNames = fileNameDialog.getZxName();
            for (int i = 0; i < 4; i++) {
                final byte[] headerblock = makeHeaderBlock(zxNames[i], data.getInfo().getStartAddress(),
                        data.length());
                final byte[] datablock = makeDataBlock(data.getDataForCPU(i));
                final byte[] dataToSave = JBBPOut.BeginBin().Byte(wellTapBlock(headerblock))
                        .Byte(wellTapBlock(datablock)).End().toByteArray();

                final File fileToSave = new File(file.getParent(), fileNames[i]);
                if (!saveDataToFile(fileToSave, dataToSave))
                    return;
            }
        }
    } else {
        final FileNameDialog fileNameDialog = new FileNameDialog(this.mainFrame, "Save as " + baseName, null,
                new String[] { prepareNameForTAP(baseZXName, 0), prepareNameForTAP(baseZXName, 1),
                        prepareNameForTAP(baseZXName, 2), prepareNameForTAP(baseZXName, 3) },
                null);
        fileNameDialog.setVisible(true);
        if (fileNameDialog.approved()) {
            final String[] zxNames = fileNameDialog.getZxName();
            final JBBPOut out = JBBPOut.BeginBin();
            for (int i = 0; i < 4; i++) {
                final byte[] headerblock = makeHeaderBlock(zxNames[i], data.getInfo().getStartAddress(),
                        data.length());
                final byte[] datablock = makeDataBlock(data.getDataForCPU(i));
                out.Byte(wellTapBlock(headerblock)).Byte(wellTapBlock(datablock));
            }
            saveDataToFile(file, out.End().toByteArray());
        }
    }

}

From source file:fi.smaa.jsmaa.gui.SMAATRIGUIFactory.java

@Override
protected void confirmDeleteAlternative(Alternative alternative) {
    if (!smaaModel.getCategories().contains(alternative)) {
        super.confirmDeleteAlternative(alternative);
    } else {/*w  w w  .j  av a2s . c o m*/
        String typeName = "category";
        int conf = JOptionPane.showConfirmDialog(parent,
                "Do you really want to delete " + typeName + " " + alternative + "?", "Confirm deletion",
                JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE,
                ImageFactory.IMAGELOADER.getIcon(FileNames.ICON_DELETE));
        if (conf == JOptionPane.YES_OPTION) {
            smaaModel.deleteCategory(alternative);
        }
    }
}

From source file:kevin.gvmsgarch.App.java

private static boolean areYouSure(Worker.ArchiveMode mode, Worker.ListLocation location, ContactFilter filter) {
    String message = "Are you sure you want to " + mode.toPrettyString() + " your messages from "
            + location.toString() + "\nfiltered by " + filter.toString() + "?";
    String warning;//  w w  w. j av  a 2  s.com
    if ((warning = mode.getWarning()) != null) {
        message += "\n\n" + warning;
    }
    return JOptionPane.showConfirmDialog(null, message, "Really really sure?", JOptionPane.YES_NO_OPTION,
            JOptionPane.INFORMATION_MESSAGE) == JOptionPane.YES_OPTION;
}

From source file:ca.uviccscu.lp.persistence.ChooseFolderDialog.java

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
    String path = jTextField3.getText();
    File f = new File(path);
    l.trace("WFolder path entered: [" + path + "]");
    int verification = SettingsManager.verifyWorkingFolder(path);
    l.trace("Initial WFolder verification: " + verification);
    if (verification != 0) {
        switch (verification) {
        case (1): {
            if (path == null || path.equals("")) {
                verification = 8;/* w  w  w.ja  v a  2  s  .c o m*/
                l.trace("WFolder  verification ch: " + verification);
                JOptionPane.showMessageDialog(this, "Path field empty!", "WFolder creation error",
                        JOptionPane.ERROR_MESSAGE);
            }
            if (verification == 1) {
                try {
                    Thread.sleep(100);
                } catch (InterruptedException ex) {
                    java.util.logging.Logger.getLogger(ChooseFolderDialog.class.getName()).log(Level.SEVERE,
                            null, ex);
                }
                int resp = JOptionPane.showConfirmDialog(this, "Directory doesn't exist! Create?",
                        "WFolder creation warning", JOptionPane.YES_NO_OPTION);
                if (resp == JOptionPane.YES_OPTION) {
                    verification = 0;
                    l.trace("WFolder verification ch: " + verification);
                } else if (resp == JOptionPane.NO_OPTION) {
                    verification = 7;
                    l.trace("WFolder verification ch: " + verification);
                }
            }
            break;
        }
        case (2): {
            if (path == null || path.equals("")) {
                verification = 8;
                l.trace("WFolder verification ch: " + verification);
                JOptionPane.showMessageDialog(this, "Path field empty!", "WFolder creation error",
                        JOptionPane.ERROR_MESSAGE);
            } else {
                JOptionPane.showMessageDialog(this, "Path not absolute!", "WFolder creation error",
                        JOptionPane.ERROR_MESSAGE);
            }
            break;
        }
        case (3): {
            JOptionPane.showMessageDialog(this, "Can't read!", "WFolder creation error",
                    JOptionPane.ERROR_MESSAGE);
            break;
        }
        case (4): {
            JOptionPane.showMessageDialog(this, "Can't write!", "WFolder creation error",
                    JOptionPane.ERROR_MESSAGE);
            break;
        }
        case (5): {
            JOptionPane.showMessageDialog(this, "File error!", "WFolder creation error",
                    JOptionPane.ERROR_MESSAGE);
            break;
        }
        case (6): {
            //JOptionPane.showMessageDialog(this, "File error!", "WFolder creation error", JOptionPane.ERROR_MESSAGE);
            l.error("Directory not empty");
            l.trace("WFolder verification ch: " + verification);
            //JDialog jd = new JDialog((JFrame) null, true);
            int resp = JOptionPane.showConfirmDialog(null,
                    "Directory nonempty: " + f.getAbsolutePath() + ". Wipe and proceed?", "Confirm deletion",
                    JOptionPane.YES_NO_OPTION);
            if (resp == JOptionPane.YES_OPTION) {
                try {
                    FileUtils.deleteDirectory(f);
                    verification = 0;
                } catch (IOException ex) {
                    l.fatal("Can't wipe directory", ex);
                    System.exit(1);
                }
            }
            break;
        }
        }
    }
    l.trace("Final WFolder verification: " + verification);
    if (verification == 0) {
        Shared.lastFolder_path = path;
        Shared.lastFolder_verification = verification;
        Shared.lastFolder_wasCancelled = false;
        this.setVisible(false);
    }
}

From source file:net.sf.jabref.importer.OpenDatabaseAction.java

/**
 * @param file the file, may be null or not existing
 *//*www.ja v  a2 s  .co  m*/
private void openTheFile(File file, boolean raisePanel) {
    if ((file != null) && file.exists()) {
        File fileToLoad = file;
        frame.output(Localization.lang("Opening") + ": '" + file.getPath() + "'");
        boolean tryingAutosave = false;
        boolean autoSaveFound = AutoSaveManager.newerAutoSaveExists(file);
        if (autoSaveFound && !Globals.prefs.getBoolean(JabRefPreferences.PROMPT_BEFORE_USING_AUTOSAVE)) {
            // We have found a newer autosave, and the preferences say we should load
            // it without prompting, so we replace the fileToLoad:
            fileToLoad = AutoSaveManager.getAutoSaveFile(file);
            tryingAutosave = true;
        } else if (autoSaveFound) {
            // We have found a newer autosave, but we are not allowed to use it without
            // prompting.
            int answer = JOptionPane.showConfirmDialog(null, "<html>"
                    + Localization.lang("An autosave file was found for this database. This could indicate "
                            + "that JabRef didn't shut down cleanly last time the file was used.")
                    + "<br>" + Localization.lang("Do you want to recover the database from the autosave file?")
                    + "</html>", Localization.lang("Recover from autosave"), JOptionPane.YES_NO_OPTION);
            if (answer == JOptionPane.YES_OPTION) {
                fileToLoad = AutoSaveManager.getAutoSaveFile(file);
                tryingAutosave = true;
            }
        }

        boolean done = false;
        while (!done) {
            String fileName = file.getPath();
            Globals.prefs.put(JabRefPreferences.WORKING_DIRECTORY, file.getPath());
            // Should this be done _after_ we know it was successfully opened?

            if (FileBasedLock.hasLockFile(file.toPath())) {
                Optional<FileTime> modificationTime = FileBasedLock.getLockFileTimeStamp(file.toPath());
                if ((modificationTime.isPresent()) && ((System.currentTimeMillis()
                        - modificationTime.get().toMillis()) > FileBasedLock.LOCKFILE_CRITICAL_AGE)) {
                    // The lock file is fairly old, so we can offer to "steal" the file:
                    int answer = JOptionPane.showConfirmDialog(null,
                            "<html>" + Localization.lang("Error opening file") + " '" + fileName + "'. "
                                    + Localization.lang("File is locked by another JabRef instance.") + "<p>"
                                    + Localization.lang("Do you want to override the file lock?"),
                            Localization.lang("File locked"), JOptionPane.YES_NO_OPTION);
                    if (answer == JOptionPane.YES_OPTION) {
                        FileBasedLock.deleteLockFile(file.toPath());
                    } else {
                        return;
                    }
                } else if (!FileBasedLock.waitForFileLock(file.toPath(), 10)) {
                    JOptionPane.showMessageDialog(null,
                            Localization.lang("Error opening file") + " '" + fileName + "'. "
                                    + Localization.lang("File is locked by another JabRef instance."),
                            Localization.lang("Error"), JOptionPane.ERROR_MESSAGE);
                    return;
                }

            }

            Charset encoding = Globals.prefs.getDefaultEncoding();
            ParserResult result;
            String errorMessage = null;
            try {
                result = OpenDatabaseAction.loadDatabase(fileToLoad, encoding);
            } catch (IOException ex) {
                LOGGER.error("Error loading database " + fileToLoad, ex);
                result = ParserResult.getNullResult();
            }
            if (result.isNullResult()) {
                JOptionPane.showMessageDialog(null,
                        Localization.lang("Error opening file") + " '" + fileName + "'",
                        Localization.lang("Error"), JOptionPane.ERROR_MESSAGE);

                String message = "<html>" + errorMessage + "<p>"
                        + (tryingAutosave ? Localization.lang(
                                "Error opening autosave of '%0'. Trying to load '%0' instead.", file.getName())
                                : ""/*Globals.lang("Error opening file '%0'.", file.getName())*/)
                        + "</html>";
                JOptionPane.showMessageDialog(null, message, Localization.lang("Error opening file"),
                        JOptionPane.ERROR_MESSAGE);

                if (tryingAutosave) {
                    tryingAutosave = false;
                    fileToLoad = file;
                } else {
                    done = true;
                }
                continue;
            } else {
                done = true;
            }

            final BasePanel panel = addNewDatabase(result, file, raisePanel);
            if (tryingAutosave) {
                panel.markNonUndoableBaseChanged();
            }

            // After adding the database, go through our list and see if
            // any post open actions need to be done. For instance, checking
            // if we found new entry types that can be imported, or checking
            // if the database contents should be modified due to new features
            // in this version of JabRef:
            final ParserResult finalReferenceToResult = result;
            SwingUtilities.invokeLater(
                    () -> OpenDatabaseAction.performPostOpenActions(panel, finalReferenceToResult, true));
        }

    }
}

From source file:com.alvermont.terraj.planet.ui.TerrainFrame.java

private void saveImageItemActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_saveImageItemActionPerformed
{//GEN-HEADEREND:event_saveImageItemActionPerformed

    int choice = pngChooser.showSaveDialog(this);

    if (choice == JFileChooser.APPROVE_OPTION) {
        try {/*from ww  w .  java 2 s .  c  o m*/
            if (!pngChooser.getFileContents().canRead() || (JOptionPane.showConfirmDialog(this,
                    "This file already exists. Do you want to\n" + "overwrite it?", "Replace File?",
                    JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)) {
                final OutputStream target = pngChooser.getFileContents().getOutputStream(true);

                // More JNLP silliness. How am I supposed to know what size
                // an image file will compress to and there is no guidance
                // in the documentation as to what value can be reasonably
                // requested here. I've just picked something and gone with
                // it, which seems to be in line with the philosophy of
                // the people who designed Java WebStart
                pngChooser.getFileContents().setMaxLength(500000);

                ImageIO.write(image,
                        PNGFileFilter.getFormatName(new File(pngChooser.getFileContents().getName())), target);

                target.close();
            }
        } catch (IOException ioe) {
            log.error("Error writing image file", ioe);

            JOptionPane.showMessageDialog(this,
                    "Error: " + ioe.getMessage() + "\nCheck log file for full details", "Error Saving",
                    JOptionPane.ERROR_MESSAGE);
        }
    }
}

From source file:com.simplexrepaginator.RepaginateFrame.java

protected JButton createInputButton() {
    JButton b = new JButton("Click or drag to set input files", PDF_1342);

    b.setHorizontalTextPosition(SwingConstants.RIGHT);
    b.setIconTextGap(25);/*from  w  w  w . ja  v  a2 s.  co m*/

    b.setTransferHandler(new InputButtonTransferHandler());

    b.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            JFileChooser chooser = new JFileChooser();
            chooser.setMultiSelectionEnabled(true);
            chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
            if (chooser.showOpenDialog(RepaginateFrame.this) != JFileChooser.APPROVE_OPTION)
                return;
            setInput(Arrays.asList(chooser.getSelectedFiles()));
            if (JOptionPane.showConfirmDialog(RepaginateFrame.this, "Use input paths as output paths?",
                    "Use Input As Output?", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                setOutput(new ArrayList<File>(repaginator.getInputFiles()));
            }
        }
    });

    return b;
}

From source file:mergedoc.ui.MergeDocFrame.java

/**
 * ???????// w w w  .  j  ava  2s  . c  o  m
 * @param pref 
 * @return ???? true
 */
private boolean isCancelByConfirm(Preference pref) {

    if (pref.getDocDirectory().getPath().length() == 0) {
        int result = dialog.showConfirmMessage(
                "Javadoc API ?????????????\n"
                        + "????????????");
        if (result != JOptionPane.YES_OPTION) {
            return true;
        }
    }
    if (pref.getOutputArchive().exists()) {
        int result = dialog
                .showConfirmMessage("?????\n"
                        + "??????");
        if (result != JOptionPane.YES_OPTION) {
            return true;
        }
    }
    return false;
}

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);/*from   w w  w . ja  v a  2s . 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);
    }
}