Package DisplayProject

Source Code of DisplayProject.FileDialogs

/*
Copyright (c) 2003-2008 ITerative Consulting Pty Ltd. All Rights Reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

o Redistributions of source code must retain the above copyright notice, this list of conditions and
the following disclaimer.
 
o Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.
   
o This jcTOOL Helper Class software, whether in binary or source form may not be used within,
or to derive, any other product without the specific prior written permission of the copyright holder

 
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


*/
package DisplayProject;

import java.awt.Component;

import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

import Framework.CustomFilter;
import Framework.DirectoryFile;
import Framework.File;
import Framework.FrameworkUtils;
import Framework.TextData;

/**
* A utility class to present File Dialogs similar to Forte.
*/
public class FileDialogs {
    private static final int cOPEN = 1;
    private static final int cSAVE = 2;

    /**
     * Private constructor to ensure this class is never instantiated.
     */
    private FileDialogs() {}

    private static int showDialog(Component c, String message,
            DirectoryFile directory, DirectoryFile selectedDir) {

        int result = 0;
        int finalResult = 0;
        JFileChooser chooser = new JFileChooser();
        if (directory == null) {
            chooser.setCurrentDirectory(new java.io.File("."));
        }
        else {
            chooser.setCurrentDirectory(directory.getNativeFile());
        }
        chooser.setDialogTitle(message);
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        result = chooser.showOpenDialog(c);

        switch (result) {
            case JFileChooser.APPROVE_OPTION:
                finalResult = javax.swing.JOptionPane.OK_OPTION;
                selectedDir.setNativeFile(chooser.getSelectedFile());
                break;

            case JFileChooser.CANCEL_OPTION:
                //finalResult = Constants.BV_CANCEL;
                finalResult = javax.swing.JOptionPane.CANCEL_OPTION;
                break;
        }
        chooser = null;
        return finalResult;
    }

    private static int showDialog(Component c, String message, String fileTypes,
        File directory, File selectedFile, int openSave) {

      return showDialog(c, message, fileTypes, directory == null ? null : directory.getNativeFile(), selectedFile, openSave);
    }

    /**
     * @param c
     * @param message
     * @param fileTypes
     * @param directory
     *            java.io.File
     * @param selectedFile
     * @param openSave
     * @return
     */
    private static int showDialog(Component c, String message, String fileTypes,
        java.io.File directory, File selectedFile, int openSave) {
     
        int result = 0;
        int finalResult = 0;
        JFileChooser fc = new JFileChooser();
       
        // TF:24/03/2009:Split the file types into different types separated by semicolons
        for (String suffix : fileTypes.split(";")) {
          CustomFilter fileFilter = new CustomFilter(suffix);
          // if (!fileTypesAdded.contains(fileTypes)) {
          // fileTypesAdded.add(fileTypes);
          // fc.addChoosableFileFilter(fileFilter);
          // }
          fc.removeChoosableFileFilter(fileFilter);
          fc.addChoosableFileFilter(fileFilter);
        }
       
        fc.setDialogTitle(message);
        fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        fc.setSelectedFile(null);
        fc.setSelectedFile(selectedFile.getNativeFile());
       
        // If the directory is not specified or if it
        // doesn't exist and the FrameworkUtils has a working directory, then use
        // that working directory.
        if (directory == null || !directory.exists()) {
          if (FrameworkUtils.getWorkingDirectory() != null) {
            directory = new java.io.File (FrameworkUtils.getWorkingDirectory());
          }
        }
       
        fc.setCurrentDirectory(directory);
       
        switch (openSave) {
          case FileDialogs.cOPEN:
              result = fc.showOpenDialog(c);
              break;
          case FileDialogs.cSAVE:
              result = fc.showSaveDialog(c);
              break;
        }
        switch (result) {
          case JFileChooser.APPROVE_OPTION:
              finalResult = JOptionPane.OK_OPTION;
              selectedFile.setNativeFile(fc.getSelectedFile());
              break;
          case JFileChooser.CANCEL_OPTION:
              finalResult = JFileChooser.CANCEL_OPTION;
              break;
        }
        fc = null;
        return finalResult;
    }


    /**
     * Display a file open dialog box on a main window, application modal with the other windows started by this thread.
     * @param c The component on which to centre the dialog. This component can be null, resulting in the dialog being shown in the centre of the screen
     * @param message The text to use as the message in the dialog
     * @param fileTypes The file types offered to the user to allow filtering of the specific kinds of files to open. Multiple file types can be
     *     separate by a semi-colon (;) such as <code>"exe;dll"</code>. The special filter of "%img" will present a list of image files of types
     *     bmp, gif, jpg and png.
     * @param directory The directory to use as a starting point for the file selection, or <code>null</code> for the current directory
     * @param selectedFile This file will be set to the file selected by the user if the user selects OK. If the user selects Cancel, the contents
     *     of this file will not be changed. This parameter must not be null.
     * @return JFileChooser.OK_OPTION or JFileChooser.CANCEL_OPTION
     * @deprecated use <code>fileOpenDialog</code> instead
     */
    public static int FileOpenDialog(Component c, TextData message, String fileTypes,
        DirectoryFile directory, Framework.File selectedFile) {
     
        return FileOpenDialog(c, TextData.valueOf(message), fileTypes, directory, selectedFile);
    }
   
    /**
     * Display a file open dialog box on a main window, application modal with the other windows started by this thread.
     * @param c The component on which to centre the dialog. This component can be null, resulting in the dialog being shown in the centre of the screen
     * @param message The text to use as the message in the dialog
     * @param fileTypes The file types offered to the user to allow filtering of the specific kinds of files to open. Multiple file types can be
     *     separate by a semi-colon (;) such as <code>"exe;dll"</code>. The special filter of "%img" will present a list of image files of types
     *     bmp, gif, jpg and png.
     * @param directory The directory to use as a starting point for the file selection, or <code>null</code> for the current directory
     * @param selectedFile This file will be set to the file selected by the user if the user selects OK. If the user selects Cancel, the contents
     *     of this file will not be changed. This parameter must not be null.
     * @return JFileChooser.OK_OPTION or JFileChooser.CANCEL_OPTION
     */
    public static int fileOpenDialog(Component c, TextData message, String fileTypes,
        DirectoryFile directory, Framework.File selectedFile) {
     
      return fileOpenDialog(c, TextData.valueOf(message), fileTypes, directory, selectedFile);
    }
   
    /**
     * Display a file open dialog box on a main window, application modal with the other windows started by this thread.
     * @param c The component on which to centre the dialog. This component can be null, resulting in the dialog being shown in the centre of the screen
     * @param message The text to use as the message in the dialog
     * @param fileTypes The file types offered to the user to allow filtering of the specific kinds of files to open. Multiple file types can be
     *     separate by a semi-colon (;) such as <code>"exe;dll"</code>. The special filter of "%img" will present a list of image files of types
     *     bmp, gif, jpg and png.
     * @param directory The directory to use as a starting point for the file selection, or <code>null</code> for the current directory
     * @param selectedFile This file will be set to the file selected by the user if the user selects OK. If the user selects Cancel, the contents
     *     of this file will not be changed. This parameter must not be null.
     * @return JFileChooser.OK_OPTION or JFileChooser.CANCEL_OPTION
     * @deprecated use <code>fileOpenDialog</code> instead
     */
    public static int FileOpenDialog(Component c, TextData message, TextData fileTypes,
        DirectoryFile directory, Framework.File selectedFile) {
     
        return FileOpenDialog(c, TextData.valueOf(message), TextData.valueOf(fileTypes), directory, selectedFile);
    }
   
    /**
     * Display a file open dialog box on a main window, application modal with the other windows started by this thread.
     * @param c The component on which to centre the dialog. This component can be null, resulting in the dialog being shown in the centre of the screen
     * @param message The text to use as the message in the dialog
     * @param fileTypes The file types offered to the user to allow filtering of the specific kinds of files to open. Multiple file types can be
     *     separate by a semi-colon (;) such as <code>"exe;dll"</code>. The special filter of "%img" will present a list of image files of types
     *     bmp, gif, jpg and png.
     * @param directory The directory to use as a starting point for the file selection, or <code>null</code> for the current directory
     * @param selectedFile This file will be set to the file selected by the user if the user selects OK. If the user selects Cancel, the contents
     *     of this file will not be changed. This parameter must not be null.
     * @return JFileChooser.OK_OPTION or JFileChooser.CANCEL_OPTION
     */
    public static int fileOpenDialog(Component c, TextData message, TextData fileTypes,
        DirectoryFile directory, Framework.File selectedFile) {
     
      return fileOpenDialog(c, TextData.valueOf(message), TextData.valueOf(fileTypes), directory, selectedFile);
    }
   
    /**
     * Display a file open dialog box on a main window, application modal with the other windows started by this thread.
     * @param c The component on which to centre the dialog. This component can be null, resulting in the dialog being shown in the centre of the screen
     * @param message The text to use as the message in the dialog
     * @param rtlMode not used
     * @param fileTypes The file types offered to the user to allow filtering of the specific kinds of files to open. Multiple file types can be
     *     separate by a semi-colon (;) such as <code>"exe;dll"</code>. The special filter of "%img" will present a list of image files of types
     *     bmp, gif, jpg and png.
     * @param directory The directory to use as a starting point for the file selection, or <code>null</code> for the current directory
     * @param selectedFile This file will be set to the file selected by the user if the user selects OK. If the user selects Cancel, the contents
     *     of this file will not be changed. This parameter must not be null.
     * @return JFileChooser.OK_OPTION or JFileChooser.CANCEL_OPTION
     * @deprecated use <code>fileOpenDialog</code> instead
     */
    public static int FileOpenDialog(Component c, TextData message, boolean rtlMode,
            String fileTypes, DirectoryFile directory, Framework.File selectedFile) {
       
      return FileOpenDialog(c, TextData.valueOf(message), fileTypes, directory, selectedFile);
    }

    /**
     * Display a file open dialog box on a main window, application modal with the other windows started by this thread.
     * @param c The component on which to centre the dialog. This component can be null, resulting in the dialog being shown in the centre of the screen
     * @param message The text to use as the message in the dialog
     * @param rtlMode not used
     * @param fileTypes The file types offered to the user to allow filtering of the specific kinds of files to open. Multiple file types can be
     *     separate by a semi-colon (;) such as <code>"exe;dll"</code>. The special filter of "%img" will present a list of image files of types
     *     bmp, gif, jpg and png.
     * @param directory The directory to use as a starting point for the file selection, or <code>null</code> for the current directory
     * @param selectedFile This file will be set to the file selected by the user if the user selects OK. If the user selects Cancel, the contents
     *     of this file will not be changed. This parameter must not be null.
     * @return JFileChooser.OK_OPTION or JFileChooser.CANCEL_OPTION
     */
    public static int fileOpenDialog(Component c, TextData message, boolean rtlMode,
        String fileTypes, DirectoryFile directory, Framework.File selectedFile) {
     
      return fileOpenDialog(c, TextData.valueOf(message), fileTypes, directory, selectedFile);
    }
   
    /**
     * Display a file open dialog box on a main window, application modal with the other windows started by this thread.
     * @param c The component on which to centre the dialog. This component can be null, resulting in the dialog being shown in the centre of the screen
     * @param message The text to use as the message in the dialog
     * @param fileTypes The file types offered to the user to allow filtering of the specific kinds of files to open. Multiple file types can be
     *     separate by a semi-colon (;) such as <code>"exe;dll"</code>. The special filter of "%img" will present a list of image files of types
     *     bmp, gif, jpg and png.
     * @param directory The directory to use as a starting point for the file selection, or <code>null</code> for the current directory
     * @param selectedFile This file will be set to the file selected by the user if the user selects OK. If the user selects Cancel, the contents
     *     of this file will not be changed. This parameter must not be null.
     * @return JFileChooser.OK_OPTION or JFileChooser.CANCEL_OPTION
     * @deprecated use <code>fileOpenDialog</code> instead
     */
    public static int FileOpenDialog(Component c, String message, String fileTypes,
        DirectoryFile directory, Framework.File selectedFile) {
     
        return showDialog(c, message, fileTypes, directory, selectedFile, cOPEN);
    }
   
    /**
     * Display a file open dialog box on a main window, application modal with the other windows started by this thread.
     * @param c The component on which to centre the dialog. This component can be null, resulting in the dialog being shown in the centre of the screen
     * @param message The text to use as the message in the dialog
     * @param fileTypes The file types offered to the user to allow filtering of the specific kinds of files to open. Multiple file types can be
     *     separate by a semi-colon (;) such as <code>"exe;dll"</code>. The special filter of "%img" will present a list of image files of types
     *     bmp, gif, jpg and png.
     * @param directory The directory to use as a starting point for the file selection, or <code>null</code> for the current directory
     * @param selectedFile This file will be set to the file selected by the user if the user selects OK. If the user selects Cancel, the contents
     *     of this file will not be changed. This parameter must not be null.
     * @return JFileChooser.OK_OPTION or JFileChooser.CANCEL_OPTION
     */
    public static int fileOpenDialog(Component c, String message, String fileTypes,
        DirectoryFile directory, File selectedFile) {
     
      return showDialog(c, message, fileTypes, directory, selectedFile, cOPEN);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileSaveDialog(Component win, String message, String fileTypes, File directory, File saveFile, boolean rtl) {
        FileSaveDialog(win, message, fileTypes, directory, saveFile);
        return 0;
    }
   
    public static int fileSaveDialog(Component win, String message, String fileTypes, File directory, File saveFile, boolean rtl) {
      fileSaveDialog(win, message, fileTypes, directory, saveFile);
      return 0;
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileOpenDialog(Component c, String message, boolean rtlMode, String fileTypes,
        DirectoryFile directory, File selectedFile) {
        return showDialog(c, message, fileTypes, directory, selectedFile, cOPEN);
    }

    public static int fileOpenDialog(Component c, String message, boolean rtlMode, String fileTypes,
        DirectoryFile directory, File selectedFile) {
      return showDialog(c, message, fileTypes, directory, selectedFile, cOPEN);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileOpenDialog(Component c, String message, String fileTypes,
        File directory, File selectedFile) {
       
      return showDialog(c, message, fileTypes, directory, selectedFile, cOPEN);
    }

    public static int fileOpenDialog(Component c, String message, String fileTypes,
        File directory, File selectedFile) {
     
      return showDialog(c, message, fileTypes, directory, selectedFile, cOPEN);
    }
   
    /**
     * The FileOpenDialog method displays a file-opening selection list dialog on a main window, which makes the window application-modal,
     * meaning that it prevents input to all other windows while it is active.
     * @deprecated use fileOpenDialog instead
     */
    public static int FileOpenDialog(Component c, String message, String fileTypes,
        java.io.File directory, File selectedFile) {
     
        return showDialog(c, message, fileTypes, directory, selectedFile, cOPEN);
    }

    /**
     * The FileOpenDialog method displays a file-opening selection list dialog on a main window, which makes the window application-modal,
     * meaning that it prevents input to all other windows while it is active.
     */
    public static int fileOpenDialog(Component c, String message, String fileTypes,
        java.io.File directory, File selectedFile) {
     
      return showDialog(c, message, fileTypes, directory, selectedFile, cOPEN);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileSaveDialog(Component c, TextData message, String fileTypes,
        File directory, File selectedFile) {
     
        return  FileSaveDialog(c, TextData.valueOf(message), fileTypes, directory, selectedFile);
    }

    public static int fileSaveDialog(Component c, TextData message, String fileTypes,
        File directory, File selectedFile) {
     
      return  fileSaveDialog(c, TextData.valueOf(message), fileTypes, directory, selectedFile);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileSaveDialog(Component c, TextData message, boolean rtl,
            String fileTypes, File directory, File selectedFile) {

      return  FileSaveDialog(c, TextData.valueOf(message), fileTypes, directory, selectedFile);
    }

    public static int fileSaveDialog(Component c, TextData message, boolean rtl,
        String fileTypes, File directory, File selectedFile) {
     
      return  fileSaveDialog(c, TextData.valueOf(message), fileTypes, directory, selectedFile);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileSaveDialog(Component c, TextData message, TextData fileTypes,
        File directory, File selectedFile) {
     
        return  FileSaveDialog(c, TextData.valueOf(message), TextData.valueOf(fileTypes),
            directory, selectedFile);
    }

    public static int fileSaveDialog(Component c, TextData message, TextData fileTypes,
        File directory, File selectedFile) {
     
      return  fileSaveDialog(c, TextData.valueOf(message), TextData.valueOf(fileTypes),
          directory, selectedFile);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileSaveDialog(Component c, TextData message, boolean rtl,
            TextData fileTypes, File directory, File selectedFile) {
     
        return  FileSaveDialog(c, TextData.valueOf(message), TextData.valueOf(fileTypes),
            directory,  selectedFile);
    }

    public static int fileSaveDialog(Component c, TextData message, boolean rtl,
        TextData fileTypes, File directory, File selectedFile) {
     
      return  fileSaveDialog(c, TextData.valueOf(message), TextData.valueOf(fileTypes),
          directory,  selectedFile);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileSaveDialog(Component c, String message,
            String fileTypes, File directory, File selectedFile) {
     
        return showDialog(c, message, fileTypes, directory, selectedFile, cSAVE);
    }

    public static int fileSaveDialog(Component c, String message,
        String fileTypes, File directory, File selectedFile) {
     
      return showDialog(c, message, fileTypes, directory, selectedFile, cSAVE);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileSaveDialog(Component c, String message, boolean rtl,
            String fileTypes, File directory, File selectedFile) {
     
        return showDialog(c, message, fileTypes, directory, selectedFile, cSAVE);
    }
   
    public static int fileSaveDialog(Component c, String message, boolean rtl,
        String fileTypes, File directory, File selectedFile) {
     
      return showDialog(c, message, fileTypes, directory, selectedFile, cSAVE);
    }
   
    /**
     * The directorySelectDialog method has a function similar to the FileSaveDialog method:
     * it permits the selection of a directory for some purpose, such as the output directory
     * for code generation.<p>
     * <p>
     * A directory selection dialog window contains a list of directories, a list of file
     * types to use as saving options, and buttons for approving or canceling the dialog.<p>
     * <p>
     * The method returns an integer value representing the button selected in the dialog:
     * BV_OK to choose the selected directory or BV_CANCEL to cancel the dialog.<p>
     * <p>
     * @param c
     * @param message
     * @param dir
     * @param resultDir
     * @return
     * @deprecated use directorySelectDialog instead
     */
    public static int DirectorySelectDialog(Component c, String message,
            DirectoryFile dir, DirectoryFile resultDir) {
        return showDialog(c, message, dir, resultDir);
    }

    /**
     * The directorySelectDialog method has a function similar to the FileSaveDialog method:
     * it permits the selection of a directory for some purpose, such as the output directory
     * for code generation.<p>
     * <p>
     * A directory selection dialog window contains a list of directories, a list of file
     * types to use as saving options, and buttons for approving or canceling the dialog.<p>
     * <p>
     * The method returns an integer value representing the button selected in the dialog:
     * BV_OK to choose the selected directory or BV_CANCEL to cancel the dialog.<p>
     * <p>
     * @param c
     * @param message
     * @param dir
     * @param resultDir
     * @return
     */
    public static int directorySelectDialog(Component c, String message,
        DirectoryFile dir, DirectoryFile resultDir) {
      return showDialog(c, message, dir, resultDir);
    }
   
    /**
     * The directorySelectDialog method has a function similar to the FileSaveDialog method:
     * it permits the selection of a directory for some purpose, such as the output directory
     * for code generation.<p>
     * <p>
     * A directory selection dialog window contains a list of directories, a list of file
     * types to use as saving options, and buttons for approving or canceling the dialog.<p>
     * <p>
     * The method returns an integer value representing the button selected in the dialog:
     * BV_OK to choose the selected directory or BV_CANCEL to cancel the dialog.<p>
     * <p>
     * @param c
     * @param message
     * @param dir
     * @param resultDir
     * @return
     * @deprecated use directorySelectDialog instead
     */
    public static int DirectorySelectDialog(Component c, TextData message,
            DirectoryFile dir, DirectoryFile resultDir) {
        return showDialog(c, message == null ? null : message.toString(), dir, resultDir);
    }

    /**
     * The directorySelectDialog method has a function similar to the FileSaveDialog method:
     * it permits the selection of a directory for some purpose, such as the output directory
     * for code generation.<p>
     * <p>
     * A directory selection dialog window contains a list of directories, a list of file
     * types to use as saving options, and buttons for approving or canceling the dialog.<p>
     * <p>
     * The method returns an integer value representing the button selected in the dialog:
     * BV_OK to choose the selected directory or BV_CANCEL to cancel the dialog.<p>
     * <p>
     * @param c
     * @param message
     * @param dir
     * @param resultDir
     * @return
     */
    public static int directorySelectDialog(Component c, TextData message,
            DirectoryFile dir, DirectoryFile resultDir) {
        return showDialog(c, message == null ? null : message.toString(), dir, resultDir);
    }

    /**
     * @deprecated use directorySelectDialog instead
     */
    public static int DirectorySelectDialog(Component c, String message, boolean rtl,
            DirectoryFile dir, DirectoryFile resultDir) {
        return showDialog(c, message, dir, resultDir);
    }

    public static int directorySelectDialog(Component c, String message, boolean rtl,
        DirectoryFile dir, DirectoryFile resultDir) {
      return showDialog(c, message, dir, resultDir);
    }
   
    /**
     * @deprecated use directorySelectDialog instead
     */
    public static int DirectorySelectDialog(Component c, TextData message, boolean rtl,
            DirectoryFile dir, DirectoryFile resultDir) {
        return showDialog(c, message == null ? null : message.toString(), dir, resultDir);
    }

    public static int directorySelectDialog(Component c, TextData message, boolean rtl,
        DirectoryFile dir, DirectoryFile resultDir) {
      return showDialog(c, message == null ? null : message.toString(), dir, resultDir);
    }
   
    /**
     * @deprecated use fileSaveDialog instead
     */
    public static int FileSaveDialog(Component c, String message, TextData fileType, File startFile, File saveFile) {
        return showDialog(c, message, fileType.toString(), startFile, saveFile, 0);
    }
   
    public static int fileSaveDialog(Component c, String message, TextData fileType, File startFile, File saveFile) {
      return showDialog(c, message, fileType.toString(), startFile, saveFile, 0);
    }
   
    //PM:21/05/2008:DET-28
    /**
     * @deprecated use fileOpenDialog instead
     */
  public static int FileOpenDialog(Component c, TextData message,  boolean rtlMode, TextData fileTypes,
      DirectoryFile directory, File selectedFile) {
    return FileOpenDialog(c, message.toString(), rtlMode, fileTypes.toString(), directory, selectedFile);
  }

  public static int fileOpenDialog(Component c, TextData message,  boolean rtlMode, TextData fileTypes,
      DirectoryFile directory, File selectedFile) {
    return fileOpenDialog(c, message.toString(), rtlMode, fileTypes.toString(), directory, selectedFile);
  }
}
TOP

Related Classes of DisplayProject.FileDialogs

TOP
Copyright © 2018 www.massapi.com. 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.