Print a view's content [message #85210] |
Mon, 28 April 2008 10:06  |
Eclipse User |
|
|
|
Hi all,
I need a view action that prints the content of a view. Is this possible
right now?
If it is, how do I do it? If not, is there a workaround for it?
Regards,
Markus
|
|
|
|
|
Re: Print a view's content [message #85370 is a reply to message #85342] |
Tue, 29 April 2008 05:06   |
Eclipse User |
|
|
|
Hi Markus,
I don't think it would make any sense to support printing this stuff in
a generic way. It may make sense for text editors but printing a forms
editor or a view with widgets makes just no sense. But with a little
workaround you could achieve something useful: Having an action which
opens a popup window (for example trough the workbench browser support)
and prefixing the content of the html page with something like the
following you could support direct printing for the user. If you now use
the adapter pattern to provide a textual content adapter for each part,
you can retrieve the adapter of the current active part to put this
content into your html page for the browser. This way you can print the
active parts content while the part itself can provide the textual
format of the output.
Here is the snippet for the html page to open the print dialog:
<html><body onload="window.print();"><!-- your text content goes here
--></body</html>
Just an idea I had when I read your post. Maybe it works ;)
Greets
Benny
Markus Krüger wrote:
> Are you planning to add some printing functionality to RAP, like printing
> views or editors content?
> I think this might be very usefull.
>
> Regards,
>
> Markus
>
> "Rüdiger Herrmann" <rherrmann@innoopract.com> schrieb im Newsbeitrag
> news:fv56e7$bst$2@build.eclipse.org...
>> Markus,
>>
>> sorry to say so, but I don't know a way to make this work.
>> The only thing that comes to my mind is to 'print' the views' content as a
>> PDF document (or similar) and show it in a Brwoser widget.
>>
>> Cheers,
>> Rüdiger
>>
>>
>> Markus Krüger wrote:
>>> Hi all,
>>> I need a view action that prints the content of a view. Is this possible
>>> right now?
>>> If it is, how do I do it? If not, is there a workaround for it?
>>>
>>> Regards,
>>> Markus
>
>
|
|
|
|
|
Re: Print a view's content [message #85544 is a reply to message #85451] |
Wed, 30 April 2008 00:37  |
Eclipse User |
|
|
|
Originally posted by: fappel.innoopract.com
Hi,
maybe you find the thread 'How to tell RAP to switch perspective from
external servlet?' helpful for your problem
Ciao
Frank
-----Ursprüngliche Nachricht-----
Von: Markus Krüger [mailto:krueger@ion.ag]
Bereitgestellt: Dienstag, 29. April 2008 15:20
Bereitgestellt in: eclipse.technology.rap
Unterhaltung: Print a view's content
Betreff: Re: Print a view's content
Nevermind, I accidently used doPost in my servlet. Do get works. So I
just need to know how to get my view within my servlet to provide the
correct content.
Regards,
Markus
"Markus Krüger" <krueger@ion.ag> schrieb im Newsbeitrag
news:fv76tb$3ib$1@build.eclipse.org...
> Hi Benny,
> very good idea. Can you provide a snippt on how to get my generated
> html body (already available through my apadter) to a browser window.
> I can just open an url.
> I even tried to use a servlet, but It does not register corretly as it
> states a 404 when I ty to open it
(http://127.0.0.1:myport/printservlet).
>
> Extension looks like this:
> <extension
>
> point="org.eclipse.equinox.http.registry.servlets">
>
> <servlet
>
> alias="/printservlet"
>
> class="raptest.PrintServlet"
>
> httpcontextId="org.eclipse.rap.httpcontext"
>
> load-on-startup="false">
>
> </servlet>
>
> </extension>
>
>
>
> Regards,
>
> Markus
>
>
>
>
>
> "Benjamin Muskalla" <bmuskalla@innoopract.com> schrieb im Newsbeitrag
> news:fv6odt$391$1@build.eclipse.org...
>> Hi Markus,
>>
>> I don't think it would make any sense to support printing this stuff
>> in a generic way. It may make sense for text editors but printing a
>> forms editor or a view with widgets makes just no sense. But with a
>> little workaround you could achieve something useful: Having an
>> action which opens a popup window (for example trough the workbench
>> browser support) and prefixing the content of the html page with
>> something like the following you could support direct printing for
>> the user. If you now use the adapter pattern to provide a textual
>> content adapter for each part, you can retrieve the adapter of the
>> current active part to put this content into your html page for the
>> browser. This way you can print the active parts content while the
>> part itself can provide the textual format of the output.
>>
>> Here is the snippet for the html page to open the print dialog:
>>
>> <html><body onload="window.print();"><!-- your text content goes here
>> --></body</html>
>>
>> Just an idea I had when I read your post. Maybe it works ;)
>>
>> Greets
>> Benny
>>
>> Markus Krüger wrote:
>>> Are you planning to add some printing functionality to RAP, like
>>> printing views or editors content?
>>> I think this might be very usefull.
>>>
>>> Regards,
>>>
>>> Markus
>>>
>>> "Rüdiger Herrmann" <rherrmann@innoopract.com> schrieb im Newsbeitrag
>>> news:fv56e7$bst$2@build.eclipse.org...
>>>> Markus,
>>>>
>>>> sorry to say so, but I don't know a way to make this work.
>>>> The only thing that comes to my mind is to 'print' the views'
>>>> content as a PDF document (or similar) and show it in a Brwoser
widget.
>>>>
>>>> Cheers,
>>>> Rüdiger
>>>>
>>>>
>>>> Markus Krüger wrote:
>>>>> Hi all,
>>>>> I need a view action that prints the content of a view. Is this
>>>>> possible right now?
>>>>> If it is, how do I do it? If not, is there a workaround for it?
>>>>>
>>>>> Regards,
>>>>> Markus
>>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.05174 seconds