com.jniwrapper.win32.ui.dialogs
Class OpenSaveFileDialog

java.lang.Object
  extended bycom.jniwrapper.win32.ui.dialogs.OpenSaveFileDialog

public class OpenSaveFileDialog
extends java.lang.Object

OpenSaveFileDialog is a wrapper for OpenFileName and SaveFileName native dialogs.


Nested Class Summary
 class OpenSaveFileDialog.OpenSaveFileDialogExtOptions
           
 class OpenSaveFileDialog.OpenSaveFileDialogOptions
           
 
Field Summary
static char DEFAULT_FILTER_SEPARATOR
           
static int FES_COMBOBOX
           
static int FES_EDIT
           
 
Constructor Summary
OpenSaveFileDialog()
           
OpenSaveFileDialog(java.io.File initialDirectory)
           
OpenSaveFileDialog(java.lang.String title)
           
OpenSaveFileDialog(java.lang.String title, java.lang.String initialDirectory)
           
OpenSaveFileDialog(java.awt.Window owner)
           
OpenSaveFileDialog(java.awt.Window owner, java.io.File initialDirectory)
           
OpenSaveFileDialog(java.awt.Window owner, java.lang.String title)
           
OpenSaveFileDialog(java.awt.Window owner, java.lang.String title, java.io.File initialDirectory)
           
OpenSaveFileDialog(java.awt.Window owner, java.lang.String title, java.lang.String initialDirectory)
           
OpenSaveFileDialog(Wnd owner)
          Creates a new dialog with a specified owner window.
OpenSaveFileDialog(Wnd owner, java.lang.String title)
          Creates a new dialog with a specified owner window and title.
OpenSaveFileDialog(Wnd owner, java.lang.String title, java.io.File initialDirectory)
          Creates a new dialog with a specified owner window and title.
 
Method Summary
protected  boolean doExecute(com.jniwrapper.Function function)
          Executes the function passed as a parameter.
 long getCurrentFilterIndex()
           
 java.lang.String getDefaultExt()
           
protected  com.jniwrapper.Callback getDialogCallback()
           
 long getErrorCode()
           
protected  OpenSaveFileDialog.OpenSaveFileDialogExtOptions getExtOptions()
           
 int getFileEditStyle()
           
 java.lang.String getFileName()
           
 java.util.List getFiles()
           
protected  void getFiles(OFNStructure ofnStructure)
          Retrieves file names from the parameter.
 java.lang.String getFilter()
           
 long getFilterIndex()
           
 char getFilterSeparator()
           
 java.lang.String getInitialDir()
           
 boolean getOpenFileName()
          Calls the OpenFileName dialog.
 OpenSaveFileDialog.OpenSaveFileDialogOptions getOptions()
           
 java.awt.Window getOwner()
           
 Wnd getOwnerWnd()
          Returns owner window handle.
 boolean getSaveFileName()
          Calls SaveFileName dialog.
 java.lang.String getTitle()
           
 boolean isForceCurrentDirectory()
           
 void setCurrentFilterIndex(long currentFilterIndex)
           
 void setDefaultExt(java.lang.String defaultExt)
           
 void setFileEditStyle(int fileEditStyle)
           
 void setFileName(java.lang.String fileName)
          Sets the predefined file name.
 void setFilter(java.lang.String filter)
          Sets filter string.
 void setFilterIndex(long filterIndex)
          Sets the index of the filter that will be selected in the dialog.
 void setFilterSeparator(char filterSeparator)
           
 void setForceCurrentDirectory(boolean forceCurrentDirectory)
          Forces dialog to open the current directory.
 void setInitialDir(java.lang.String initialDir)
          Sets initial directory where the diloag will be opened.
 void setOwner(java.awt.Window owner)
          Sets the owner of the dialog.
 void setOwnerWnd(Wnd ownerWnd)
          Sets new owner window handle.
 void setTitle(java.lang.String title)
          Sets the title of the dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_FILTER_SEPARATOR

public static final char DEFAULT_FILTER_SEPARATOR
See Also:
Constant Field Values

FES_EDIT

public static final int FES_EDIT
See Also:
Constant Field Values

FES_COMBOBOX

public static final int FES_COMBOBOX
See Also:
Constant Field Values
Constructor Detail

OpenSaveFileDialog

public OpenSaveFileDialog(java.awt.Window owner,
                          java.lang.String title,
                          java.lang.String initialDirectory)

OpenSaveFileDialog

public OpenSaveFileDialog()

OpenSaveFileDialog

public OpenSaveFileDialog(java.lang.String title)

OpenSaveFileDialog

public OpenSaveFileDialog(java.awt.Window owner)

OpenSaveFileDialog

public OpenSaveFileDialog(java.awt.Window owner,
                          java.lang.String title)

OpenSaveFileDialog

public OpenSaveFileDialog(java.awt.Window owner,
                          java.lang.String title,
                          java.io.File initialDirectory)

OpenSaveFileDialog

public OpenSaveFileDialog(java.lang.String title,
                          java.lang.String initialDirectory)

OpenSaveFileDialog

public OpenSaveFileDialog(java.io.File initialDirectory)

OpenSaveFileDialog

public OpenSaveFileDialog(java.awt.Window owner,
                          java.io.File initialDirectory)

OpenSaveFileDialog

public OpenSaveFileDialog(Wnd owner)
Creates a new dialog with a specified owner window.

Parameters:
owner - owner's window handle;

OpenSaveFileDialog

public OpenSaveFileDialog(Wnd owner,
                          java.lang.String title,
                          java.io.File initialDirectory)
Creates a new dialog with a specified owner window and title.

Parameters:
owner - owner's window handle;
title - dialog's title;
initialDirectory - initial folder that dialog will open;

OpenSaveFileDialog

public OpenSaveFileDialog(Wnd owner,
                          java.lang.String title)
Creates a new dialog with a specified owner window and title.

Parameters:
owner - owner's window handle;
title - dialog's title;
Method Detail

getOwner

public java.awt.Window getOwner()

setOwner

public void setOwner(java.awt.Window owner)
Sets the owner of the dialog.

Parameters:
owner -

setOwnerWnd

public void setOwnerWnd(Wnd ownerWnd)
Sets new owner window handle.

Parameters:
ownerWnd - owner window handle

getOwnerWnd

public Wnd getOwnerWnd()
Returns owner window handle.

Returns:
owner window handle

getFilterSeparator

public char getFilterSeparator()

setFilterSeparator

public void setFilterSeparator(char filterSeparator)

getOptions

public OpenSaveFileDialog.OpenSaveFileDialogOptions getOptions()
Returns:
OpenSaveFileDialog.OpenSaveFileDialogOptions that contains standard dialog option. These options customize the dialog behavior and style.

getFilter

public java.lang.String getFilter()

setFilter

public void setFilter(java.lang.String filter)
Sets filter string. Filter string should have FilterName|Extension format. Several filters should be delimeted by filter delimeter character '|'. Several extensions should be delimeted by ';' symbol. Example: "XML Files|*.utils|Pictures|*.bmp;*.gif;*.jpeg"

Parameters:
filter -

getFilterIndex

public long getFilterIndex()
Returns:
selected filter index.

setFilterIndex

public void setFilterIndex(long filterIndex)
Sets the index of the filter that will be selected in the dialog.

Parameters:
filterIndex -

getCurrentFilterIndex

public long getCurrentFilterIndex()

setCurrentFilterIndex

public void setCurrentFilterIndex(long currentFilterIndex)
Parameters:
currentFilterIndex -

getInitialDir

public java.lang.String getInitialDir()

setInitialDir

public void setInitialDir(java.lang.String initialDir)
Sets initial directory where the diloag will be opened.

Parameters:
initialDir -

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String title)
Sets the title of the dialog.

Parameters:
title -

getDefaultExt

public java.lang.String getDefaultExt()

setDefaultExt

public void setDefaultExt(java.lang.String defaultExt)

getFileName

public java.lang.String getFileName()
Returns:
selected file name. If multiselection is on, it returns the first file name from the list of selected ones.

setFileName

public void setFileName(java.lang.String fileName)
Sets the predefined file name.

Parameters:
fileName -

getFiles

public java.util.List getFiles()
Returns:
a list of files. If multiselection is disallowed, it contains only one selected file; otherwise it contains all selected files.

getFileEditStyle

public int getFileEditStyle()

setFileEditStyle

public void setFileEditStyle(int fileEditStyle)

getExtOptions

protected OpenSaveFileDialog.OpenSaveFileDialogExtOptions getExtOptions()
Returns:
OpenSaveFileDialog.OpenSaveFileDialogExtOptions contains extended dialog options. These options work only on Win2k, WinMe or greater.

isForceCurrentDirectory

public boolean isForceCurrentDirectory()

setForceCurrentDirectory

public void setForceCurrentDirectory(boolean forceCurrentDirectory)
Forces dialog to open the current directory.

Parameters:
forceCurrentDirectory -

getDialogCallback

protected com.jniwrapper.Callback getDialogCallback()

doExecute

protected boolean doExecute(com.jniwrapper.Function function)
Executes the function passed as a parameter.

Parameters:
function -
Returns:
true if the function is executed successfully.

getErrorCode

public long getErrorCode()

getFiles

protected void getFiles(OFNStructure ofnStructure)
Retrieves file names from the parameter.

Parameters:
ofnStructure -

getOpenFileName

public boolean getOpenFileName()
Calls the OpenFileName dialog.

Returns:
true if file(s) is selected; otherwise false.

getSaveFileName

public boolean getSaveFileName()
Calls SaveFileName dialog.

Returns:
true if file(s) is selected; otherwise false.