edu.cs.ai.kreator.ui
Interface KreatorFileChooser

All Known Implementing Classes:
FileChooser

public interface KreatorFileChooser

Describes a file chooser used by KReator. This can for example be a JFileChooser from Swing, or some own implementation, for usage in a command line version of KReator.

Author:
Niklas Wulf, Adam Chachaj

Field Summary
static int DIRECTORIES_ONLY
           
static int FILES_AND_DIRECTORIES
           
static int FILES_ONLY
           
 
Method Summary
 void addAllButProjectFileFilters()
           
 void addAllFileFilters()
          Adds all known KReator file filters to the file chooser.
 void addChoosableFileFilter(AbstractFileFilter filefilter)
          Adds a file filter to this file chooser
 java.io.File getCurrentDirectory()
          Returns the currently open directory as an absolute file.
 java.io.File getSelectedFile()
          Returns the currently selected file.
 java.io.File[] getSelectedFiles()
          Returns the currently selected files, or null if no file is selected.
 void removeAllFileFilter()
          Removes the standard java all file filter.
 void setCurrentDirectory(java.io.File dir)
          Sets the current directory.
 void setDialogTitle(java.lang.String title)
          Sets the title of this dialog.
 void setFileSelectionMode(int mode)
          Sets the mode in which this dialog lets the user select files.
 void setMultiSelectionEnabled(boolean enableMultiSelection)
          Enables or disables multi-selection, if this file chooser supports multi-selection.
 void setSelectedFile(java.io.File directoryOrFile)
          If directoryOrFile is a directory, sets the current directory of this file chooser.
 int showOpenDialog()
           
 int showSaveDialog()
           
 

Field Detail

FILES_ONLY

static final int FILES_ONLY
See Also:
Constant Field Values

DIRECTORIES_ONLY

static final int DIRECTORIES_ONLY
See Also:
Constant Field Values

FILES_AND_DIRECTORIES

static final int FILES_AND_DIRECTORIES
See Also:
Constant Field Values
Method Detail

addChoosableFileFilter

void addChoosableFileFilter(AbstractFileFilter filefilter)
Adds a file filter to this file chooser

Parameters:
filefilter -

addAllFileFilters

void addAllFileFilters()
Adds all known KReator file filters to the file chooser.


addAllButProjectFileFilters

void addAllButProjectFileFilters()

removeAllFileFilter

void removeAllFileFilter()
Removes the standard java all file filter.


setSelectedFile

void setSelectedFile(java.io.File directoryOrFile)
If directoryOrFile is a directory, sets the current directory of this file chooser.
If directoryOrFile is a file, it sets the current directory to its parent and the filename to its name.

Parameters:
directoryOrFile -

getSelectedFiles

java.io.File[] getSelectedFiles()
Returns the currently selected files, or null if no file is selected.

Returns:
the currently selected files, or null if no file is selected.

setCurrentDirectory

void setCurrentDirectory(java.io.File dir)
Sets the current directory.


getSelectedFile

java.io.File getSelectedFile()
Returns the currently selected file.

Returns:
the currently selected file.

getCurrentDirectory

java.io.File getCurrentDirectory()
Returns the currently open directory as an absolute file.

Returns:
the currently open directory as an absolute file.

setMultiSelectionEnabled

void setMultiSelectionEnabled(boolean enableMultiSelection)
Enables or disables multi-selection, if this file chooser supports multi-selection. Defaults to true.

Parameters:
enableMultiSelection - if true multi-selection is enabled. If false multi-selection is disabled.

setDialogTitle

void setDialogTitle(java.lang.String title)
Sets the title of this dialog.

Parameters:
title -

setFileSelectionMode

void setFileSelectionMode(int mode)
Sets the mode in which this dialog lets the user select files.

Parameters:
mode -
See Also:
FILES_AND_DIRECTORIES, FILES_ONLY, DIRECTORIES_ONLY

showOpenDialog

int showOpenDialog()
Returns:

showSaveDialog

int showSaveDialog()
Returns: