Question on viewing html content [message #174755] |
Tue, 18 July 2006 13:31 |
Eclipse User |
|
|
|
Originally posted by: katja.henttonen.vtt.fi
I am building an Eclipse plug-in for managing a knowledge base. This
involves
storing html-files in a database and viewing them in Eclipse.
Let's say I have a string buffer which contains a HTML document. How
can I show it in an Eclipse view? I would like to show plain text (as in a
web
browser) not hml source code. I don't want to create a temporary
file on hard disk.
I can show contents of the buffer in a TextViewer, but this obviously
shows it as it is (=html source code) and not as as in a web browser.
The document does not contain hyper links or references to other files.
I could create a parser and remove all html tags from the string buffer
before showing it. But do you know a smarter way to atchieve what I need?
All answers are highly appreciated.
Thank you in advance.
Katja
ps. If my question was not clear, let me know.
|
|
|
|
Re: Question on viewing html content [message #174882 is a reply to message #174803] |
Wed, 19 July 2006 10:56 |
Eclipse User |
|
|
|
Originally posted by: katja.henttonen.vtt.fi
This is a multi-part message in MIME format.
------=_NextPart_000_0010_01C6AB3B.318C3450
Content-Type: text/plain;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
Many thanks for your reply. I have already been looking at the class =
org.eclipse.ui.browser.IWebBrowser, which
I suppose is what you had in mind too. The interface only provides =
method "open_url" which takes java.net.URL as an input
parameter. I'm a complete newbie on the area, but I'll try to see if I =
could use data URI scheme to pass my string to the browser...
Katja
"Gilbert Andrews" <gilberta@ca.ibm.com> wrote in message =
news:51ed2a2429192f83e8c68223477f0f8e$1@www.eclipse.org...
> Im probably not the best expert in this but there is an internal =
browser=20
> you can launch. You could post the stream to that perhaps.
>
------=_NextPart_000_0010_01C6AB3B.318C3450
Content-Type: text/html;
charset="iso-8859-15"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-15">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Many thanks for your =
reply. I have=20
already been looking at the class =
org.eclipse.ui.browser.IWebBrowser, =20
which</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I suppose is what you had in mind =
too. The=20
interface only provides method "open_url" which takes java.net.URL =
as an=20
input</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>parameter. I'm a complete =
newbie on the=20
area, but I'll try to see if I could use data URI scheme to pass my =
string=20
to the browser...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Katja</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial><BR><BR><FONT =
size=3D2></FONT></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>"Gilbert Andrews" <</FONT><A=20
href=3D"mailto:gilberta@ca.ibm.com"><FONT face=3DArial=20
size=3D2>gilberta@ca.ibm.com</FONT></A><FONT face=3DArial size=3D2>> =
wrote in=20
message </FONT><A=20
href=3D"news:51ed2a2429192f83e8c68223477f0f8e$1@www.eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:51ed2a2429192f83e8c68223477f0f8e$1@www.eclipse.org</FONT></=
A><FONT=20
face=3DArial size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> =
Im probably not=20
the best expert in this but there is an internal browser <BR>> you =
can=20
launch. You could post the stream to that =
perhaps.<BR>></FONT></BODY></HTML>
------=_NextPart_000_0010_01C6AB3B.318C3450--
|
|
|
|
Re: Question on viewing html content [message #175037 is a reply to message #175014] |
Wed, 19 July 2006 21:04 |
|
Gilbert Andrews wrote:
> Hi Katja
> You are right, there is only a space for a url. I dont know why they
> would do this perhaps this is a requirement of the browser. Ive been
> told you can be sneaky and jam the html in through the widget. Im not
> sure this is the right answer.
> I guess using a temp file would be out of the question :(
The SWT Browser widget is probably what you were thinking of, as it
can take a simple string for display.
--
- Nitin
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: Question on viewing html content [message #175130 is a reply to message #175037] |
Thu, 20 July 2006 11:11 |
Eclipse User |
|
|
|
Originally posted by: katja.henttonen.vtt.fi
This is a multi-part message in MIME format.
------=_NextPart_000_0031_01C6AC06.624A1000
Content-Type: text/plain;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
The SWT widget (org.eclipse.swt.browser.Browser) is indeed what I am =
looking for.
Many thanks to both of you for replying and helping an Eclipse newbie.=20
Katja
"Nitin Dahyabhai" <nitind@us.ibm.com> wrote in message =
news:e9m6pa$f7f$1@utils.eclipse.org...
> Gilbert Andrews wrote:
>> Hi Katja
>> You are right, there is only a space for a url. I dont know why they=20
>> would do this perhaps this is a requirement of the browser. Ive been=20
>> told you can be sneaky and jam the html in through the widget. Im not =
>> sure this is the right answer.
>> I guess using a temp file would be out of the question :(
>=20
> The SWT Browser widget is probably what you were thinking of, as it=20
> can take a simple string for display.
>=20
> --=20
> - Nitin
------=_NextPart_000_0031_01C6AC06.624A1000
Content-Type: text/html;
charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<META content=3D"MSHTML 6.00.2900.2912" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>The SWT widget=20
(org.eclipse.swt.browser.Browser) is indeed what I am looking=20
for.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Many thanks to both of you for replying =
and helping=20
an Eclipse newbie. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Katja</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>"Nitin Dahyabhai" <</FONT><A=20
href=3D"mailto:nitind@us.ibm.com"><FONT face=3DArial=20
size=3D2>nitind@us.ibm.com</FONT></A><FONT face=3DArial size=3D2>> =
wrote in message=20
</FONT><A href=3D"news:e9m6pa$f7f$1@utils.eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:e9m6pa$f7f$1@utils.eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>> Gilbert =
Andrews=20
wrote:<BR>>> Hi Katja<BR>>> You are right, there is only a =
space for=20
a url. I dont know why they <BR>>> would do this perhaps this is a =
requirement of the browser. Ive been <BR>>> told you can be sneaky =
and jam=20
the html in through the widget. Im not <BR>>> sure this is the =
right=20
answer.<BR>>> I guess using a temp file would be out of the =
question=20
:(<BR>> <BR>> The SWT Browser widget is probably what you were =
thinking=20
of, as it <BR>> can take a simple string for display.<BR>> =
<BR>> --=20
<BR>> - Nitin</FONT></BODY></HTML>
------=_NextPart_000_0031_01C6AC06.624A1000--
|
|
|
Powered by
FUDForum. Page generated in 0.04356 seconds