ASF Bugzilla – Attachment 31023 Details for
Bug 55753
Improve FilePanel behaviour to start from the value set in Filename field if any
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Path
BUG_55753.patch (text/plain), 3.45 KB, created by
UbikLoadPack support
on 2013-11-07 07:34:14 UTC
(
hide
)
Description:
Path
Filename:
MIME Type:
Creator:
UbikLoadPack support
Created:
2013-11-07 07:34:14 UTC
Size:
3.45 KB
patch
obsolete
>Index: src/core/org/apache/jmeter/gui/util/FileDialoger.java >=================================================================== >--- src/core/org/apache/jmeter/gui/util/FileDialoger.java (revision 1538289) >+++ src/core/org/apache/jmeter/gui/util/FileDialoger.java (working copy) >@@ -23,6 +23,7 @@ > import javax.swing.JFileChooser; > import javax.swing.filechooser.FileFilter; > >+import org.apache.commons.lang3.StringUtils; > import org.apache.jmeter.gui.GuiPackage; > import org.apache.jmeter.gui.JMeterFileFilter; > >@@ -43,6 +44,15 @@ > private FileDialoger() { > } > >+ >+ public static JFileChooser promptToOpenFile() { >+ return promptToOpenFile((String)null); >+ } >+ >+ public static JFileChooser promptToOpenFile(String existingFileName) { >+ return promptToOpenFile(new String[0], existingFileName); >+ } >+ > /** > * Prompts the user to choose a file from their filesystems for our own > * devious uses. This method maintains the last directory the user visited >@@ -55,9 +65,27 @@ > * finished using it - null if no file was chosen > */ > public static JFileChooser promptToOpenFile(String[] exts) { >+ return promptToOpenFile(exts, null); >+ } >+ >+ /** >+ * Prompts the user to choose a file from their filesystems for our own >+ * devious uses. This method maintains the last directory the user visited >+ * before dismissing the dialog. This does NOT imply they actually chose a >+ * file from that directory, only that they closed the dialog there. It is >+ * the caller's responsibility to check to see if the selected file is >+ * non-null. >+ * >+ * @return the JFileChooser that interacted with the user, after they are >+ * finished using it - null if no file was chosen >+ */ >+ public static JFileChooser promptToOpenFile(String[] exts, String existingFileName) { > // JFileChooser jfc = null; > >- if (lastJFCDirectory == null) { >+ if(!StringUtils.isEmpty(existingFileName)) { >+ jfc.setCurrentDirectory(new File(existingFileName)); >+ } >+ else if (lastJFCDirectory == null) { > String start = System.getProperty("user.dir", ""); //$NON-NLS-1$//$NON-NLS-2$ > > if (start.length() > 0) { >@@ -87,10 +115,6 @@ > } > } > >- public static JFileChooser promptToOpenFile() { >- return promptToOpenFile(new String[0]); >- } >- > /** > * Prompts the user to choose a file from their filesystems for our own > * devious uses. This method maintains the last directory the user visited >Index: src/core/org/apache/jmeter/gui/util/FilePanelEntry.java >=================================================================== >--- src/core/org/apache/jmeter/gui/util/FilePanelEntry.java (revision 1538289) >+++ src/core/org/apache/jmeter/gui/util/FilePanelEntry.java (working copy) >@@ -136,9 +136,9 @@ > if (e.getActionCommand().equals(ACTION_BROWSE)) { > JFileChooser chooser; > if(filetypes == null || filetypes.length == 0){ >- chooser = FileDialoger.promptToOpenFile(); >+ chooser = FileDialoger.promptToOpenFile(filename.getText()); > } else { >- chooser = FileDialoger.promptToOpenFile(filetypes); >+ chooser = FileDialoger.promptToOpenFile(filetypes, filename.getText()); > } > if (chooser != null && chooser.getSelectedFile() != null) { > filename.setText(chooser.getSelectedFile().getPath());
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 55753
: 31023