Home » Eclipse Projects » Remote Application Platform (RAP) » rap file dialog(problem in creatinf a file dialog)
rap file dialog [message #658144] |
Mon, 07 March 2011 05:40 |
marie Missing name Messages: 63 Registered: March 2011 |
Member |
|
|
Hi all,
i m creating a rap application,but i m facing a problem while creating file dialog in my application,i have tried with file upload but it is not working with the same
FileDialog fileDialog = new FileDialog(getWorkbenchShell(), SWT.SAVE);
fileDialog.setFilterExtensions(new String[] {"*.xml"});
String xmlFilePath = null;
/* if named export file already exists in File System , display warning msg and depends
* upon user input proceed*/
do{
xmlFilePath = fileDialog.open();
if( xmlFilePath == null )
return false;
xmlFileDir = fileDialog.getFilterPath();
fileName = fileDialog.getFileName();
can anybody help me to resolve the problem.
thnak in advance
[Updated on: Mon, 07 March 2011 05:40] Report message to a moderator
|
|
| | | | | | | | |
Re: rap file dialog [message #688088 is a reply to message #688078] |
Thu, 23 June 2011 22:15 |
|
Hi John,
My fault, I had the namespace wrong in the bundle names. Actually it's
org.eclipse.rap.rwt.supplemental.filedialog! I've also corrected the bundle names in the blog post. Thanks for pointing out the problem.
I'm sorry for the confusion.
Best regards,
Ralf
|
|
| |
Re: rap file dialog [message #688507 is a reply to message #688097] |
Fri, 24 June 2011 20:24 |
John Yotka Messages: 144 Registered: July 2009 |
Senior Member |
|
|
On 6/23/2011 4:30 PM, John Yotka wrote:
> On 6/23/2011 4:15 PM, Ralf Sternberg wrote:
>> Hi John,
>>
>> My fault, I had the namespace wrong in the bundle names. Actually it's
>> org.eclipse.rap.rwt.supplemental.filedialog! I've also corrected the
>> bundle names in the blog post. Thanks for pointing out the problem.
>>
>> I'm sorry for the confusion.
>>
>> Best regards,
>> Ralf
>>
> Thanks again for your prompt help! I think the bundle name may actually
> be: org.eclipse.rap.rwt.supplemental.fileupload. I found that in the
> list and it solved my problem.
I spoke too soon, the compile errors went away, and I have these 2 jars
(C:\eclipse\workspaces\indigo\.metadata\.plugins\org.eclipse.pde.core\.bundle_pool\plugins)
org.eclipse.rap.rwt.supplemental.filedialog_1.4.0.201106201014.jar
org.eclipse.rap.rwt.supplemental.fileupload_1.4.0.201106201014.jar
in my plug-in dependencies, but when I try to run the app I get the
following error:
!ENTRY com.datria.DVA.translatePrompts.editor 4 0 2011-06-24 14:15:08.766
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle
"com.datria.DVA.translatePrompts.editor_1.0.0.qualifier [116]" could not
be resolved. Reason: Missing Constraint: Import-Package:
org.eclipse.rap.rwt.supplemental.fileupload.internal; version="0.0.0"
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1311)
I don't understand this, since the jars exist and Eclipse shows that
they are in the .bundle_pool directory (in the "Plug-in Dependencies" in
the Package Explorer.
|
|
|
Re: rap file dialog [message #688710 is a reply to message #688507] |
Sat, 25 June 2011 12:43 |
|
Did you include all needed jars in your launch config? Did you try to press "Verify" in the Run Configurations editor? What does a "ss" in your OSGi console give?
|
|
| | | |
Re: rap file dialog [message #689564 is a reply to message #689533] |
Mon, 27 June 2011 20:22 |
John Yotka Messages: 144 Registered: July 2009 |
Senior Member |
|
|
On 6/27/2011 1:26 PM, Ralf Sternberg wrote:
> Hi John,
>
> No idea what your problem could be. What does the bundle manifest of the
> bundle that contains TranslatePromptsEditorAdvisor look like?
>
> Ralf
>
here is the manifest.mf for the project containing
TranslatePromptsEditorAdvisor:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.datria.DVA.translatePrompts.editor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
Bundle-Activator:
translatePrompts.presentation.TranslatePromptsEditorPlugin$Implementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: translatePrompts.presentation
Require-Bundle: org.eclipse.core.runtime,
com.datria.DVA.translatePrompts.edit;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.core.commands;visibility:=reexport,
org.eclipse.rap.ui
Import-Package: org.apache.commons.fileupload;version="1.2.0",
org.apache.commons.fileupload.disk;version="1.2.0",
org.apache.commons.fileupload.portlet;version="1.2.0",
org.apache.commons.fileupload.servlet;version="1.2.0",
org.apache.commons.fileupload.util;version="1.2.0",
org.apache.commons.io;version="1.3.2",
org.apache.commons.io.filefilter;version="1.3.2",
org.apache.commons.io.input;version="1.3.2",
org.apache.commons.io.output;version="1.3.2",
org.eclipse.emf.common.ui,
org.eclipse.emf.common.ui.action,
org.eclipse.emf.common.ui.dialogs,
org.eclipse.emf.common.ui.editor,
org.eclipse.emf.common.ui.viewer,
org.eclipse.emf.edit.ui,
org.eclipse.emf.edit.ui.action,
org.eclipse.emf.edit.ui.celleditor,
org.eclipse.emf.edit.ui.dnd,
org.eclipse.emf.edit.ui.provider,
org.eclipse.emf.edit.ui.util,
org.eclipse.emf.edit.ui.view,
org.eclipse.jface.action,
org.eclipse.jface.dialogs,
org.eclipse.jface.operation,
org.eclipse.jface.viewers,
org.eclipse.jface.window,
org.eclipse.jface.wizard,
org.eclipse.rap.rwt.supplemental.fileupload,
org.eclipse.swt,
org.eclipse.swt.custom,
org.eclipse.swt.dnd,
org.eclipse.swt.events,
org.eclipse.swt.graphics,
org.eclipse.swt.layout,
org.eclipse.swt.widgets,
org.eclipse.ui;ui.workbench=split,
org.eclipse.ui.actions;ui.workbench=split,
org.eclipse.ui.application,
org.eclipse.ui.part;ui.workbench=split,
org.eclipse.ui.views,
org.eclipse.ui.views.contentoutline,
org.eclipse.ui.views.properties;ui.views=split
Bundle-ActivationPolicy: lazy
|
|
|
Re: rap file dialog [message #689702 is a reply to message #689564] |
Tue, 28 June 2011 08:06 |
|
As I explained in the blog post, I'd recommend using Require-Bundle for org.eclipse.rap.rwt.filedialog here. Because of the split-package, Import-Package will not work here.
|
|
|
Re: rap file dialog [message #689916 is a reply to message #689702] |
Tue, 28 June 2011 15:11 |
John Yotka Messages: 144 Registered: July 2009 |
Senior Member |
|
|
On 6/28/2011 2:06 AM, Ralf Sternberg wrote:
> As I explained in the blog post, I'd recommend using Require-Bundle for
> org.eclipse.rap.rwt.filedialog here. Because of the split-package,
> Import-Package will not work here.
Ralf, sorry I missed that, but I have updated the manifiest and still
get the same error (java.lang.NoClassDefFoundError:
org/eclipse/swt/widgets/FileDialog).
I've tried several variants of the manifest (with and without the
fileupload in the Required-Bundle).
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: com.datria.DVA.translatePrompts.editor;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: .
Bundle-Activator:
translatePrompts.presentation.TranslatePromptsEditorPlugin$Implementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: translatePrompts.presentation
Require-Bundle: org.eclipse.core.runtime,
com.datria.DVA.translatePrompts.edit;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.core.commands;visibility:=reexport,
org.eclipse.rap.rwt.supplemental.filedialog,
org.eclipse.rap.rwt.supplemental.fileupload,
org.eclipse.rap.ui
Import-Package: org.apache.commons.fileupload;version="1.2.0",
org.apache.commons.fileupload.disk;version="1.2.0",
org.apache.commons.fileupload.portlet;version="1.2.0",
|
|
|
Re: rap file dialog [message #690039 is a reply to message #689916] |
Tue, 28 June 2011 20:36 |
|
I'm sorry, John, I can't spot the problem. Sometimes a re-compile helps.
If not, what I would try next is to create a new Plug-in Project with an
simple snippet-like IEntryPoint implementation that contains a file
dialog. Add a bundle dependency to org.eclipse.rap.ui and to
org.eclipse.rap.rwt.supplemental.filedialog.
If this works, the problem must be in your code. If it does not, then
maybe there's something wrong in your target...
HTH, Ralf
--
Ralf Sternberg
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Re: rap file dialog [message #690562 is a reply to message #690039] |
Wed, 29 June 2011 17:34 |
John Yotka Messages: 144 Registered: July 2009 |
Senior Member |
|
|
On 6/28/2011 2:36 PM, Ralf Sternberg wrote:
> I'm sorry, John, I can't spot the problem. Sometimes a re-compile helps.
>
> If not, what I would try next is to create a new Plug-in Project with an
> simple snippet-like IEntryPoint implementation that contains a file
> dialog. Add a bundle dependency to org.eclipse.rap.ui and to
> org.eclipse.rap.rwt.supplemental.filedialog.
>
> If this works, the problem must be in your code. If it does not, then
> maybe there's something wrong in your target...
>
> HTH, Ralf
>
I haven't yet solved the issue running in my PDE environment, but was
able to successfully deploy this app as a WAR and the FileDialog does
come up. But after selecting a file on the server, the returned name of
the file is a temp name, e.g., "upload.49572.tmp" and not the name of
the selected file. What am I doing wrong?
|
|
| | |
Re: rap file dialog [message #691097 is a reply to message #691077] |
Thu, 30 June 2011 17:26 |
|
Hi John,
> I created a report (bug 350857).
Thanks for the bug report!
> But my problem my be something different. What I was looking for was a
> FileDialog that behaves as the current SWT FileDialog behaves, that is
> it returns the full path (URI) of the selected files, it doesn't upload
> anything.
Unfortunately, you cannot determine the full path of a selected file on
the client. Only a few browsers provide the path information (IE, Opera,
IIRC).
If you're only interested in the file names, use the new FileUpload
widget. This widget lets the user select a file from the local file
system. Although its purpose is to upload files, you can also use it
just to listen to a file selection (simply add a SelectionListener).
> I might rename your FileDialog to FileUploadDialog, since that
> is the purpose of it.
It's named FileDialog because it implements an existing SWT API and thus
allows for code re-use.
> I can probably use your code example to accomplish what I need but I
> don't know how to obtain the full path (URI) from the FileUpload
> (browseButton in UploadPanel). Presently it only returns the file name
> (+ext).
Yes, see above.
Best regards, Ralf
--
Ralf Sternberg
Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/
Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
|
|
|
Goto Forum:
Current Time: Fri Apr 26 19:23:00 GMT 2024
Powered by FUDForum. Page generated in 0.04587 seconds
|