Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.util.swing
Interface SipCommFileChooser

All Known Implementing Classes:
SipCommFileChooserImpl, SipCommFileDialogImpl

public interface SipCommFileChooser

The purpose of this interface is to provide an unique way to access to the methods of JFileChooser (javax.swing) or FileDialog (java.awt). It's interesting to use FileDialog under Mac OS X because it uses the native user interface for file selection provided by Mac OS which is more practical than the user interface performed by a JFileChooser (on Mac). Therefore, under other platforms (Microsoft Windows, Linux), the use of JFileChooser instead of FileDialog performs a better user interface for browsing among a file hierarchy.

Author:
Valentin Martinet

Field Summary
static int DIRECTORIES_ONLY
          Instruction to display only directories in file chooser dialog.
static int FILES_ONLY
          Instruction to display only files.
static int LOAD_FILE_OPERATION
          Allows to request a 'load file' dialog (optional)
static int SAVE_FILE_OPERATION
          Allows to request a 'save file' dialog (optional)
 
Method Summary
 void addFilter(SipCommFileFilter filter)
          Adds a file filter to this dialog.
 File getApprovedFile()
          Returns the selected file by the user from the dialog.
 File getFileFromDialog()
          Shows the dialog and returns the selected file.
 SipCommFileFilter getUsedFilter()
          Returns the filter the user has chosen for saving a file.
 void setSelectionMode(int mode)
          Change the selection mode for the file choose.
 void setStartPath(String path)
          Sets the default path to be considered for browsing among files.
 

Field Detail

LOAD_FILE_OPERATION

static final int LOAD_FILE_OPERATION
Allows to request a 'load file' dialog (optional)

See Also:
Constant Field Values

SAVE_FILE_OPERATION

static final int SAVE_FILE_OPERATION
Allows to request a 'save file' dialog (optional)

See Also:
Constant Field Values

FILES_ONLY

static final int FILES_ONLY
Instruction to display only files.

See Also:
Constant Field Values

DIRECTORIES_ONLY

static final int DIRECTORIES_ONLY
Instruction to display only directories in file chooser dialog.

See Also:
Constant Field Values
Method Detail

setSelectionMode

void setSelectionMode(int mode)
Change the selection mode for the file choose. Possible values are DIRECTORIES_ONLY or FILES_ONLY, default is FILES_ONLY.

Parameters:
mode - the mode to use.

getApprovedFile

File getApprovedFile()
Returns the selected file by the user from the dialog.

Returns:
File the selected file from the dialog

setStartPath

void setStartPath(String path)
Sets the default path to be considered for browsing among files.

Parameters:
path - the default start path for this dialog

getFileFromDialog

File getFileFromDialog()
Shows the dialog and returns the selected file.

Returns:
File the selected file in this dialog

addFilter

void addFilter(SipCommFileFilter filter)
Adds a file filter to this dialog.

Parameters:
filter - the filter to add

getUsedFilter

SipCommFileFilter getUsedFilter()
Returns the filter the user has chosen for saving a file.

Returns:
SipCommFileFilter the used filter when saving a file

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.