LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJFileDialog

java.lang.Object
  extended by leon.view.win.swing.component.LyJFileDialog

public class LyJFileDialog
extends java.lang.Object

This class defines a component containing a text field and a button. A click on the button opens a dialog which allows to select a file. The selector may have a type indicating the mime-type of the files that may be chosen (text, image, audio, video...).

See Also:
LyJSelector

Field Summary
static java.lang.String __VERSION
           
static int TYPE_AUDIO
          Audio type.
static int TYPE_DIRECTORY
          Directory type.
static int TYPE_IMAGE
          Image type.
static int TYPE_TEXT
          Text type.
static int TYPE_VIDEO
          Video type.
 
Constructor Summary
LyJFileDialog(java.awt.Frame parent, java.lang.String title, LyFile.Type type, java.lang.String directory, java.lang.String filter)
          Creates and initializes a new file dialog.
 
Method Summary
 java.lang.String getDirectory()
          Gets the directory in which the files are selected.
 java.lang.String getFile()
          Gets the path of the selected file.
 void setDirectory(java.io.File file)
          Sets the current directory on dialog opening.
 void setFile(java.io.File file)
          Allows to select initial value of the file chooser.
 int show()
          Shows the file chooser dialog.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

TYPE_TEXT

public static final int TYPE_TEXT
Text type.

See Also:
Constant Field Values

TYPE_IMAGE

public static final int TYPE_IMAGE
Image type.

See Also:
Constant Field Values

TYPE_AUDIO

public static final int TYPE_AUDIO
Audio type.

See Also:
Constant Field Values

TYPE_VIDEO

public static final int TYPE_VIDEO
Video type.

See Also:
Constant Field Values

TYPE_DIRECTORY

public static final int TYPE_DIRECTORY
Directory type.

See Also:
Constant Field Values
Constructor Detail

LyJFileDialog

public LyJFileDialog(java.awt.Frame parent,
                     java.lang.String title,
                     LyFile.Type type,
                     java.lang.String directory,
                     java.lang.String filter)
Creates and initializes a new file dialog.

Parameters:
parent - the parent component
title - the title of the dialog
type - the type of files to show (see _type)
directory - the path to the starting directory
filter - a filter for the file names to show
Method Detail

show

public int show()
Shows the file chooser dialog.

Returns:
the return state of the file chooser on popdown:
  • JFileChooser.CANCEL_OPTION
  • JFileChooser.APPROVE_OPTION
  • JFileChooser.ERROR_OPTION if an error occurs or the dialog is dismissed
See Also:
JFileChooser.showOpenDialog(java.awt.Component)

getDirectory

public java.lang.String getDirectory()
Gets the directory in which the files are selected.

Returns:
the working directory
See Also:
setDirectory(File)

getFile

public java.lang.String getFile()
Gets the path of the selected file.

Returns:
the path to the selected file in the dialog
See Also:
setFile(File)

setFile

public void setFile(java.io.File file)
Allows to select initial value of the file chooser.

Parameters:
file - he initial file or directory
See Also:
getFile(), JFileChooser.setSelectedFile(java.io.File)

setDirectory

public void setDirectory(java.io.File file)
Sets the current directory on dialog opening.

Parameters:
file - a directory or a file in the directory to use
See Also:
JFileChooser.setCurrentDirectory(java.io.File), getDirectory()

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com