    //@include lib_Class.js

    importPackage(java.io);

    /**
     * This class provides common dialogs
     * e.g for saving files
     *
     * @author Michael Weiler, ELO Digital Office GmbH
     * @version 1.0
     *
     * @elojc
     */
    sol.define("sol.common.jc.CommonDialogs", {

      singleton: true,

      /**
       * Shows a save dialog
       * @param {Object} dialogConfig Configuration for the dialog
       * @param {String} dialogConfig.title Title of the dialog
       * @param {String} dialogConfig.filterName Name of the file filter.
       * @param {String} dialogConfig.filterExtension Extension of the file filter.
       * @param {String} dialogConfig.dir Destination folder
       * @param {String} dialogConfig.fileName File name
       * @return {java.io.File} selected File
       */
      showSaveDialog: function (dialogConfig) {
        var me = this,
            fileChooser, returnCode;

        fileChooser = me.createFileChooser(dialogConfig),
        fileChooser.dialogType = javax.swing.JFileChooser.SAVE_DIALOG;
        returnCode = fileChooser.showSaveDialog(null);
        if (returnCode == javax.swing.JFileChooser.APPROVE_OPTION) {
          return fileChooser.selectedFile;
        }
      },

      /**
       * Shows a open dialog
       * @param {Object} dialogConfig Configuration for the dialog
       * @param {String} dialogConfig.title Title of the dialog
       * @param {String} dialogConfig.filterName Name of the file filter.
       * @param {String} dialogConfig.filterExtension Extension of the file filter.
       * @param {String} dialogConfig.dir Destination folder
       * @param {String} dialogConfig.fileName File name
       * @return {java.io.File} selected File
       */
      showOpenDialog: function (dialogConfig) {
        var me = this,
            fileChooser, returnCode;

        fileChooser = me.createFileChooser(dialogConfig),
        fileChooser.dialogType = javax.swing.JFileChooser.OPEN_DIALOG;
        returnCode = fileChooser.showOpenDialog(null);
        if (returnCode == javax.swing.JFileChooser.APPROVE_OPTION) {
          return fileChooser.selectedFile;
        }
      },

      /**
       * @private
       * Creates a file chooser dialog
       * @param {Object} dialogConfig Configuration for the dialog
       * @return {javax.swing.JFileChooser}
       */
      createFileChooser: function (dialogConfig) {
        var fileChooser = new javax.swing.JFileChooser(),
            fileFilter;
        if (dialogConfig.title) {
          fileChooser.dialogTitle = dialogConfig.title;
        }

        if (dialogConfig.filterName && dialogConfig.filterExtension) {
          fileFilter = new javax.swing.filechooser.FileNameExtensionFilter(dialogConfig.filterName, dialogConfig.filterExtension);
          fileChooser.fileFilter = fileFilter;
        }

        if (dialogConfig.dir) {
          fileChooser.currentDirectory = dialogConfig.dir;
        }

        if (dialogConfig.fileName) {
          fileChooser.selectedFile = new File(dialogConfig.fileName);
        }

        if (dialogConfig.directoriesOnly) {
          fileChooser.fileSelectionMode = javax.swing.JFileChooser.DIRECTORIES_ONLY;
        }

        return fileChooser;
      }
    });