net.sf.jaxodraw.gui.panel
Class JaxoChooseFile

java.lang.Object
  extended by net.sf.jaxodraw.gui.panel.JaxoChooseFile

public class JaxoChooseFile
extends Object

Opens a file chooser dialog that is used for opening, saving and exporting files.

Since:
2.0

Constructor Summary
JaxoChooseFile(Component parentc)
          Constructor.
JaxoChooseFile(Component parentc, String text)
          Constructor.
 
Method Summary
 String chooseFile(String[] allowedExtensions, String description, String selectedFile)
          Brings up a file chooser dialog.
 String getApproveText()
          Text for the JFileChooser approve button.
 Component getComponentParent()
          Parent component for the dialog.
 String getDialogTitle()
          Title to be used for dialogs.
 void setApproveText(String value)
          The text for the approve button.
 void setComponentParent(Component value)
          Sets the parent component.
 void setDialogTitle(String value)
          Sets the dialog title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JaxoChooseFile

public JaxoChooseFile(Component parentc)
Constructor.

Parameters:
parentc - The parent component.

JaxoChooseFile

public JaxoChooseFile(Component parentc,
                      String text)
Constructor.

Parameters:
parentc - The parent component.
text - The text to use as a dialog title.
Method Detail

getComponentParent

public final Component getComponentParent()
Parent component for the dialog.

Returns:
The parent component.

setComponentParent

public void setComponentParent(Component value)
Sets the parent component.

Parameters:
value - The parent component.

getApproveText

public final String getApproveText()
Text for the JFileChooser approve button. Must be set.

Returns:
The approve button text.

setApproveText

public void setApproveText(String value)
The text for the approve button.

Parameters:
value - The approve button text.

getDialogTitle

public final String getDialogTitle()
Title to be used for dialogs. If 'null' (the default), a default will be created using the approve text, but this is typically inferior to setting a custom one.

Returns:
The dialog title.

setDialogTitle

public void setDialogTitle(String value)
Sets the dialog title.

Parameters:
value - The dialog title.

chooseFile

public final String chooseFile(String[] allowedExtensions,
                               String description,
                               String selectedFile)
Brings up a file chooser dialog.

Parameters:
selectedFile - A file that should be marked as pre-selected.
allowedExtensions - Files with these extensions (and directories) will be shown. May be 'null' indication no filtering.
description - A description of this dialog.
Returns:
A string with the absolute path of the chosen file, or an empty string, if no file was selected.


Copyright © 2003-2011 The JaxoDraw team. All Rights Reserved.