private void closeSelectedSpecifications()
    {
        List<SpecificationDocument> selectedSpecifications = selectedSpecifications();

        if (selectedSpecifications.isEmpty())
            {
            return;
            }

        boolean hasEditedDocuments = hasEditedDocuments(selectedSpecifications);

        String closeSelectedTextKey = hasEditedDocuments ? "fileWarning.closeSpecification.edited.message" : "fileWarning.closeSpecification.message";
        int dialogOption = hasEditedDocuments ? JOptionPane.YES_NO_CANCEL_OPTION : JOptionPane.YES_NO_OPTION;

        int result = JOptionPane.showConfirmDialog(this,
                                                   uiBundle.getString(closeSelectedTextKey),
                                                   uiBundle.getString("fileWarning.closeSpecification.confirm"),
                                                   dialogOption);

        // if there are no edited documents and the user wants to close them, don't check, close
        // if there are no edited documents and the user doesn't want to close them, don't check, don't close
        // if there are edited documents and the user doesn't want to close, don't check, don't close
        // if there are edited documents and the user wants to close without saving, don't check, close
        // if there are edited documents and the user wants to close with saving, check, close
        boolean shouldCheck = (hasEditedDocuments && (result == JOptionPane.YES_OPTION));
        boolean shouldClose = ((result == JOptionPane.YES_OPTION)
                || (hasEditedDocuments && (result == JOptionPane.NO_OPTION)));

        if (shouldClose)
            {
            closeSpecifications(selectedSpecifications, shouldCheck);
            }
    }