Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » any widget for file viewing?
any widget for file viewing? [message #634350] Thu, 21 October 2010 07:37 Go to next message
Eclipse UserFriend
Hi,

Is there any SWT widget for file viewing, i mean not any file dialog but a viewer being integrated in my app...

Thanks!
Re: any widget for file viewing? [message #635060 is a reply to message #634350] Mon, 25 October 2010 10:34 Go to previous messageGo to next message
Eclipse UserFriend
If you're asking if there's a control for showing any file with any
arbitrary type, then no this doesn't exist. You can use the Program class
to look up the viewer/editor associated with a file type, and if one is
found then you can launch it externally with the content to show (Program
snippets: http://www.eclipse.org/swt/snippets#program ).

If this is not what you were asking then please follow up.

Grant


<lqb@yomolo.com> wrote in message news:i9p8fq$jg7$1@news.eclipse.org...
> Hi,
>
> Is there any SWT widget for file viewing, i mean not any file dialog but a
> viewer being integrated in my app...
>
> Thanks!
Re: any widget for file viewing? [message #635064 is a reply to message #635060] Mon, 25 October 2010 10:52 Go to previous messageGo to next message
Eclipse UserFriend
Sorry to explain me so so sooo confusing... I meant, file browsing, like if it was an explorer.exe. List all the files and navigate through folders and pick up one file...


Grant Gayed wrote on Mon, 25 October 2010 10:34
If you're asking if there's a control for showing any file with any
arbitrary type, then no this doesn't exist. You can use the Program class
to look up the viewer/editor associated with a file type, and if one is
found then you can launch it externally with the content to show (Program
snippets: http://www.eclipse.org/swt/snippets#program ).

If this is not what you were asking then please follow up.

Grant


<lqb@yomolo.com> wrote in message news:i9p8fq$jg7$1@news.eclipse.org...
> Hi,
>
> Is there any SWT widget for file viewing, i mean not any file dialog but a
> viewer being integrated in my app...
>
> Thanks!

Re: any widget for file viewing? [message #635094 is a reply to message #635064] Mon, 25 October 2010 11:19 Go to previous messageGo to next message
Eclipse UserFriend
I see, so you mean the native file dialog, but in a Control rather than in a
stand-alone OS dialog? If so then no, this does not exist. I think it was
previously requested in bugzilla, but could not be implemented due to lack
of native support.

Implementing this functionality yourself is reasonably straight-forward
though, and there's an swt example you can look at that does this. It's
called FileViewer and it's in the swt examples download. For instructions
on getting the swt examples see http://www.eclipse.org/swt/examples.php .
If for some reason you have problems getting the examples then the two
classes that make up this example are directly accessible via the links
below, you'll just need to hack them to not depend on the additional
external strings and icons that are usually part of the example.

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer /FileViewer.java
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer /IconCache.java

HTH,
Grant


<lqb@yomolo.com> wrote in message news:ia45c3$li1$1@news.eclipse.org...
> Sorry to explain me so so sooo confusing... I meant, file browsing, like
> if it was an explorer.exe. List all the files and navigate through folders
> and pick up one file...
>
>
> Grant Gayed wrote on Mon, 25 October 2010 10:34
>> If you're asking if there's a control for showing any file with any
>> arbitrary type, then no this doesn't exist. You can use the Program
>> class to look up the viewer/editor associated with a file type, and if
>> one is found then you can launch it externally with the content to show
>> (Program snippets: http://www.eclipse.org/swt/snippets#program ).
>>
>> If this is not what you were asking then please follow up.
>>
>> Grant
>>
>>
>> <lqb@yomolo.com> wrote in message news:i9p8fq$jg7$1@news.eclipse.org...
>> > Hi,
>> >
>> > Is there any SWT widget for file viewing, i mean not any file dialog
>> > but a viewer being integrated in my app...
>> >
>> > Thanks!
>
>
Re: any widget for file viewing? [message #635098 is a reply to message #635094] Mon, 25 October 2010 11:53 Go to previous message
Eclipse UserFriend
Thanks!

I figured there wouldn't exist. That's what i was looking for, i'll implement a widget, when it's done i'll post it on sourceforge... Thanks for your help!


Grant Gayed wrote on Mon, 25 October 2010 11:19
I see, so you mean the native file dialog, but in a Control rather than in a
stand-alone OS dialog? If so then no, this does not exist. I think it was
previously requested in bugzilla, but could not be implemented due to lack
of native support.

Implementing this functionality yourself is reasonably straight-forward
though, and there's an swt example you can look at that does this. It's
called FileViewer and it's in the swt examples download. For instructions
on getting the swt examples see http://www.eclipse.org/swt/examples.php .
If for some reason you have problems getting the examples then the two
classes that make up this example are directly accessible via the links
below, you'll just need to hack them to not depend on the additional
external strings and icons that are usually part of the example.

http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer /FileViewer.java
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer /IconCache.java

HTH,
Grant


<lqb@yomolo.com> wrote in message news:ia45c3$li1$1@news.eclipse.org...
> Sorry to explain me so so sooo confusing... I meant, file browsing, like
> if it was an explorer.exe. List all the files and navigate through folders
> and pick up one file...
>
>
> Grant Gayed wrote on Mon, 25 October 2010 10:34
>> If you're asking if there's a control for showing any file with any
>> arbitrary type, then no this doesn't exist. You can use the Program
>> class to look up the viewer/editor associated with a file type, and if
>> one is found then you can launch it externally with the content to show
>> (Program snippets: http://www.eclipse.org/swt/snippets#program ).
>>
>> If this is not what you were asking then please follow up.
>>
>> Grant
>>
>>
>> <lqb@yomolo.com> wrote in message news:i9p8fq$jg7$1@news.eclipse.org...
>> > Hi,
>> >
>> > Is there any SWT widget for file viewing, i mean not any file dialog
>> > but a viewer being integrated in my app...
>> >
>> > Thanks!
>
>

Previous Topic:SWT: RTL capability for dialogs
Next Topic:How to hook widgets in editor to global cut/copy/paste?
Goto Forum:
  


Current Time: Sun Jul 13 06:55:27 EDT 2025

Powered by FUDForum. Page generated in 0.04421 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top