|
|
|
|
@ -28,10 +28,15 @@ public class SipCommFileChooserImpl
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param title title for this dialog
|
|
|
|
|
* @param operation 'Save file' or 'Load file' operation
|
|
|
|
|
*/
|
|
|
|
|
public SipCommFileChooserImpl()
|
|
|
|
|
public SipCommFileChooserImpl(String title, int operation)
|
|
|
|
|
{
|
|
|
|
|
super();
|
|
|
|
|
this.setDialogTitle(title);
|
|
|
|
|
this.setDialogType(operation);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -39,43 +44,13 @@ public SipCommFileChooserImpl()
|
|
|
|
|
*
|
|
|
|
|
* @param path
|
|
|
|
|
*/
|
|
|
|
|
public SipCommFileChooserImpl(Component pparent, String path)
|
|
|
|
|
public SipCommFileChooserImpl(
|
|
|
|
|
Component pparent, String path, String title, int operation)
|
|
|
|
|
{
|
|
|
|
|
this();
|
|
|
|
|
this(title, operation);
|
|
|
|
|
this.setStartPath(path);
|
|
|
|
|
this.parent = pparent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Constructor
|
|
|
|
|
*
|
|
|
|
|
* @param path
|
|
|
|
|
* @param fileOperation
|
|
|
|
|
*/
|
|
|
|
|
public SipCommFileChooserImpl(Component parent, String path, int fileOperation)
|
|
|
|
|
{
|
|
|
|
|
this(parent, path);
|
|
|
|
|
|
|
|
|
|
if(fileOperation == SipCommFileChooser.LOAD_FILE_OPERATION)
|
|
|
|
|
{
|
|
|
|
|
this.setDialogType(JFileChooser.OPEN_DIALOG);
|
|
|
|
|
}
|
|
|
|
|
else if(fileOperation == SipCommFileChooser.SAVE_FILE_OPERATION)
|
|
|
|
|
{
|
|
|
|
|
this.setDialogType(JFileChooser.SAVE_DIALOG);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
throw new Exception("UnknownFileOperation");
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns the selected file by the user from the dialog.
|
|
|
|
|
|