IDEMPIERE-1605 - Save path when working with attachments.

This commit is contained in:
dantam 2013-12-05 11:46:48 +01:00
parent 52c4a94a22
commit c50915609c
1 changed files with 11 additions and 1 deletions

View File

@ -64,6 +64,11 @@ public final class Attachment extends CDialog
*/ */
private static final long serialVersionUID = 2497487523050526742L; private static final long serialVersionUID = 2497487523050526742L;
/**
* Save the last path selected
*/
private static String lastPath = null;
/** /**
* Constructor. * Constructor.
* loads Attachment, if ID <> 0 * loads Attachment, if ID <> 0
@ -424,7 +429,8 @@ public final class Attachment extends CDialog
private void loadFile() private void loadFile()
{ {
log.info(""); log.info("");
JFileChooser chooser = new JFileChooser(); JFileChooser chooser = new JFileChooser(lastPath);
chooser.setDialogType(JFileChooser.OPEN_DIALOG); chooser.setDialogType(JFileChooser.OPEN_DIALOG);
chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentNew")); chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentNew"));
chooser.setMultiSelectionEnabled(true); chooser.setMultiSelectionEnabled(true);
@ -463,6 +469,10 @@ public final class Attachment extends CDialog
} }
} }
} }
// Save path of file
if (files.length>0) {
lastPath = files[0].getParentFile().getAbsolutePath();
}
} // getFileName } // getFileName
/** /**