Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Question on viewing html content
Question on viewing html content [message #174755] Tue, 18 July 2006 13:31 Go to next message
Eclipse UserFriend
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 #174803 is a reply to message #174755] Tue, 18 July 2006 18:02 Go to previous messageGo to next message
Gilbert Andrews is currently offline Gilbert AndrewsFriend
Messages: 10
Registered: July 2009
Junior Member
Im probably not the best expert in this but there is an internal browser
you can launch. You could post the stream to that perhaps.
Re: Question on viewing html content [message #174882 is a reply to message #174803] Wed, 19 July 2006 10:56 Go to previous messageGo to next message
Eclipse UserFriend
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&nbsp;&nbsp;for your =
reply.&nbsp; I have=20
already been looking at the class =
org.eclipse.ui.browser.IWebBrowser,&nbsp;=20
which</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I&nbsp;suppose is what you had in mind =
too. The=20
interface only provides method "open_url"&nbsp; which takes java.net.URL =
as an=20
input</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>parameter.&nbsp; I'm a complete =
newbie&nbsp;on the=20
area, but I'll try to&nbsp;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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Katja</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial><BR><BR><FONT =
size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Gilbert Andrews" &lt;</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>&gt; =
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>&gt; =
Im probably not=20
the best expert in this but there is an internal browser <BR>&gt; you =
can=20
launch. You could post the stream to that =
perhaps.<BR>&gt;</FONT></BODY></HTML>

------=_NextPart_000_0010_01C6AB3B.318C3450--
Re: Question on viewing html content [message #175014 is a reply to message #174882] Wed, 19 July 2006 20:51 Go to previous messageGo to next message
Gilbert Andrews is currently offline Gilbert AndrewsFriend
Messages: 10
Registered: July 2009
Junior Member
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 :(
Re: Question on viewing html content [message #175037 is a reply to message #175014] Wed, 19 July 2006 21:04 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

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 Go to previous message
Eclipse UserFriend
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&nbsp;widget=20
(org.eclipse.swt.browser.Browser)&nbsp;is indeed what I&nbsp;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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Katja</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Nitin Dahyabhai" &lt;</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>&gt; =
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>&gt; Gilbert =
Andrews=20
wrote:<BR>&gt;&gt; Hi Katja<BR>&gt;&gt; You are right, there is only a =
space for=20
a url. I dont know why they <BR>&gt;&gt; would do this perhaps this is a =

requirement of the browser. Ive been <BR>&gt;&gt; told you can be sneaky =
and jam=20
the html in through the widget. Im not <BR>&gt;&gt; sure this is the =
right=20
answer.<BR>&gt;&gt; I guess using a temp file would be out of the =
question=20
:(<BR>&gt; <BR>&gt; The SWT Browser widget is probably what you were =
thinking=20
of, as it <BR>&gt; can take a simple string for display.<BR>&gt; =
<BR>&gt; --=20
<BR>&gt; - Nitin</FONT></BODY></HTML>

------=_NextPart_000_0031_01C6AC06.624A1000--
Previous Topic:WTP 1.5 and EJB 3.0
Next Topic:Enterprise Application Project Structure - missing non-EJB business or middle ti
Goto Forum:
  


Current Time: Fri Apr 26 21:26:08 GMT 2024

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

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

Back to the top