Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 202587 Details for
Bug 356438
[FileDialog] in addition to filePaths also provide fileNames of uploaded files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposed patch
patch_RAP_issue_356438.diff (text/plain), 4.05 KB, created by
Werner Hihn
on 2011-09-01 03:58:03 EDT
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Werner Hihn
Created:
2011-09-01 03:58:03 EDT
Size:
4.05 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt.supplemental.filedialog >Index: src/org/eclipse/swt/widgets/FileDialog.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/incubator/supplemental/fileupload/org.eclipse.rap.rwt.supplemental.filedialog/src/org/eclipse/swt/widgets/FileDialog.java,v >retrieving revision 1.4.2.1 >diff -u -r1.4.2.1 FileDialog.java >--- src/org/eclipse/swt/widgets/FileDialog.java 15 Jun 2011 14:47:26 -0000 1.4.2.1 >+++ src/org/eclipse/swt/widgets/FileDialog.java 1 Sep 2011 07:55:41 -0000 >@@ -71,8 +71,10 @@ > // SWT FileDialog API fields > String[] filterNames = new String[ 0 ]; > String[] filterExtensions = new String[ 0 ]; >+ String[] filePaths = new String[ 0 ]; > String[] fileNames = new String[ 0 ]; > String filterPath = ""; >+ String filePath; > String fileName; > int filterIndex; > boolean overwrite = false; >@@ -164,7 +166,7 @@ > } > > /** >- * Returns the path of the first file that was selected in the dialog relative >+ * Returns the name of the first file that was selected in the dialog relative > * to the filter path, or an empty string if no such file has been selected. > * > * @return the relative path of the file >@@ -174,8 +176,17 @@ > } > > /** >- * Returns a (possibly empty) array with the paths of all files that were >- * selected in the dialog relative to the filter path. >+ * Returns the path of the first file that was selected in the dialog relative >+ * to the filter path, or an empty string if no such file has been selected. >+ * >+ * @return the relative path of the file >+ */ >+ public String getFilePath() { >+ return filePath; >+ } >+ /** >+ * Returns a (possibly empty) array with the names of all files that were >+ * selected in the dialog. > * > * @return the relative paths of the files > */ >@@ -184,6 +195,16 @@ > } > > /** >+ * Returns a (possibly empty) array with the paths of all files that were >+ * selected in the dialog relative to the filter path. >+ * >+ * @return the relative paths of the files >+ */ >+ public String[] getFilePaths() { >+ return filePaths; >+ } >+ >+ /** > * Returns the file extensions which the dialog will use to filter the files > * it shows. > * >@@ -252,6 +273,17 @@ > } > > /** >+ * Set the initial filepath which the dialog will select by default when >+ * opened to the argument, which may be null. The name will be prefixed with >+ * the filter path when one is supplied. >+ * >+ * @param string the file name >+ */ >+ public void setFilePath( String string ) { >+ filePath = string; >+ } >+ >+ /** > * Set the file extensions which the dialog will use to filter the files it > * shows to the argument, which may be null. > * <p> >@@ -356,7 +388,7 @@ > createControls(); > layoutAndCenterShell(); > openShell(); >- return fileName; >+ return filePath; > } > > private void initializeDefaults() { >@@ -665,14 +697,20 @@ > if( uploadLocked ) { > if( progressCollector.isFinished() ) { > okButton.setText( okText ); >+ filePaths = new String[ uploadPanels.size() ]; > fileNames = new String[ uploadPanels.size() ]; >+ filePath = null; > fileName = null; > for( int i = 0; i < uploadPanels.size(); i++ ) { > UploadPanel uploadPanel = ( UploadPanel )uploadPanels.get( i ); > File uploadedFile = uploadPanel.getUploadedFile(); > // TODO [rst] Understand if file can be null > if( uploadedFile != null ) { >- fileNames[ i ] = uploadedFile.getAbsolutePath(); >+ filePaths[ i ] = uploadedFile.getAbsolutePath(); >+ fileNames[ i ] = uploadedFile.getName(); >+ } >+ if( filePath == null || filePath.length() == 0 ) { >+ filePath = filePaths[ 0 ]; > } > if( fileName == null || fileName.length() == 0 ) { > fileName = fileNames[ 0 ];
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 356438
: 202587