Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » how to add formatted text in a table cell.
how to add formatted text in a table cell. [message #326368] Tue, 18 March 2008 08:09 Go to next message
Eclipse UserFriend
Originally posted by: deeptisuri124.yahoo.com

Hi

I want to know how to add formatted text in a table cell.
Also, i do not want to apply the same formatting to the entire string in the
cell(as shown below)

I am using a table viewer to display search results for a search string
entered by the user. In one column of the table i am dispalying the sentence
in which the string occurred.Now i want the search string to be highlighted
in the sentence being shown in the table viewer.

For eg:
If the search string is 'CPU'

Event ID Matching String
1 CPU Utilization low
23 low CPU memory
45 low CPU utilization



I am trying to do this by using a TableEditor with a styled text widget.
But the problem with this is , the editors do not get disposed each time
search is pressed.

Is there any other way to do this?
Re: how to add formatted text in a table cell. [message #326369 is a reply to message #326368] Tue, 18 March 2008 08:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: deeptisuri124.yahoo.com

This is a multi-part message in MIME format.

------=_NextPart_000_002F_01C88902.A58A66F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi

I want to know how to add formatted text in a table cell.
Also, i do not want to apply the same formatting to the entire string in =
the=20
cell(as shown below)

I am using a table viewer to display search results for a search string=20
entered by the user. In one column of the table i am dispalying the =
sentence=20
in which the string occurred.Now i want the search string to be =
highlighted=20
in the sentence being shown in the table viewer.

For eg:
If the search string is 'CPU'

Event ID Matching String
1 CPU Utilization low
23 low CPU memory
45 low CPU utilization

"Deepti" <deeptisuri124@yahoo.com> wrote in message =
news:frnta3$us1$1@build.eclipse.org...
> Hi
>=20
> I want to know how to add formatted text in a table cell.
> Also, i do not want to apply the same formatting to the entire string =
in the=20
> cell(as shown below)
>=20
> I am using a table viewer to display search results for a search =
string=20
> entered by the user. In one column of the table i am dispalying the =
sentence=20
> in which the string occurred.Now i want the search string to be =
highlighted=20
> in the sentence being shown in the table viewer.
>=20
> For eg:
> If the search string is 'CPU'
>=20
> Event ID Matching String
> 1 CPU Utilization low
> 23 low CPU memory
> 45 low CPU utilization
>=20
>=20
>=20
> I am trying to do this by using a TableEditor with a styled text =
widget.
> But the problem with this is , the editors do not get disposed each =
time=20
> search is pressed.
>=20
> Is there any other way to do this?=20
>=20
>
------=_NextPart_000_002F_01C88902.A58A66F0
Content-Type: text/html;
charset="iso-8859-1"
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-1">
<META content=3D"MSHTML 6.00.2900.3268" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi<BR><BR>I want to know how to add =
formatted text=20
in a table cell.<BR>Also, i do not want to apply the same formatting to =
the=20
entire string in the <BR>cell(as shown below)<BR><BR>I am using a table =
viewer=20
to display search results for a search string <BR>entered by the user. =
In one=20
column of the table i am dispalying the sentence <BR>in which the string =

occurred.Now i want the search string to be highlighted <BR>in the =
sentence=20
being shown in the table viewer.<BR><BR>For eg:<BR>If the search string =
is=20
'CPU'<BR><BR>Event ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp; Matching =

String<BR> 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
<STRONG><FONT color=3D#008080>CPU</FONT></STRONG> Utilization=20
low<BR> 23&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;=20
low <STRONG><FONT color=3D#008080>CPU</FONT></STRONG>=20
memory<BR> 45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;=20
low <STRONG><FONT color=3D#008080>CPU =
</FONT></STRONG>utilization<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>"Deepti" &lt;</FONT><A=20
href=3D"mailto:deeptisuri124@yahoo.com"><FONT face=3DArial=20
size=3D2>deeptisuri124@yahoo.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A href=3D"news:frnta3$us1$1@build.eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:frnta3$us1$1@build.eclipse.org</FONT></A><FONT =
face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; Hi<BR>&gt; =
<BR>&gt; I want=20
to know how to add formatted text in a table cell.<BR>&gt; Also, i do =
not want=20
to apply the same formatting to the entire string in the <BR>&gt; =
cell(as shown=20
below)<BR>&gt; <BR>&gt; I am using a table viewer to display search =
results for=20
a search string <BR>&gt; entered by the user. In one column of the table =
i am=20
dispalying the sentence <BR>&gt; in which the string occurred.Now i want =
the=20
search string to be highlighted <BR>&gt; in the sentence being shown in =
the=20
table viewer.<BR>&gt; <BR>&gt; For eg:<BR>&gt; If the search string is=20
'CPU'<BR>&gt; <BR>&gt; Event =
ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;=20
Matching String<BR>&gt;=20
1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
CPU Utilization low<BR>&gt;=20
23&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;=20
low CPU memory<BR>&gt;=20
45&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;=20
low CPU utilization<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; I am trying to do =
this by=20
using a TableEditor with a styled text widget.<BR>&gt; But the problem =
with this=20
is , the editors do not get disposed each time <BR>&gt; search is=20
pressed.<BR>&gt; <BR>&gt; Is there any other way to do this? <BR>&gt;=20
<BR>&gt;</FONT></BODY></HTML>

------=_NextPart_000_002F_01C88902.A58A66F0--
Re: how to add formatted text in a table cell. [message #326379 is a reply to message #326369] Tue, 18 March 2008 14:01 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Hi,

In 3.3 you'll have to use owner draw but I'd suggest to wait for 3.4
because there we provide StyledTextLabelProvider. See
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.s nippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippet s/viewers/Snippet049StyledCellLabelProvider.java?view=markup

Tom

Deepti schrieb:
> Hi
>
> I want to know how to add formatted text in a table cell.
> Also, i do not want to apply the same formatting to the entire string in
> the
> cell(as shown below)
>
> I am using a table viewer to display search results for a search string
> entered by the user. In one column of the table i am dispalying the
> sentence
> in which the string occurred.Now i want the search string to be highlighted
> in the sentence being shown in the table viewer.
>
> For eg:
> If the search string is 'CPU'
>
> Event ID Matching String
> 1 *CPU* Utilization low
> 23 low *CPU* memory
> 45 low *CPU *utilization
> "Deepti" <deeptisuri124@yahoo.com <mailto:deeptisuri124@yahoo.com>>
> wrote in message news:frnta3$us1$1@build.eclipse.org...
> > Hi
> >
> > I want to know how to add formatted text in a table cell.
> > Also, i do not want to apply the same formatting to the entire string
> in the
> > cell(as shown below)
> >
> > I am using a table viewer to display search results for a search string
> > entered by the user. In one column of the table i am dispalying the
> sentence
> > in which the string occurred.Now i want the search string to be
> highlighted
> > in the sentence being shown in the table viewer.
> >
> > For eg:
> > If the search string is 'CPU'
> >
> > Event ID Matching String
> > 1 CPU Utilization low
> > 23 low CPU memory
> > 45 low CPU utilization
> >
> >
> >
> > I am trying to do this by using a TableEditor with a styled text widget.
> > But the problem with this is , the editors do not get disposed each time
> > search is pressed.
> >
> > Is there any other way to do this?
> >
> >


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Previous Topic:Table Viewer Vs Nebula Grid Viewer
Next Topic:Can I prevent the Help View from opening on F1?
Goto Forum:
  


Current Time: Sun Jul 07 05:24:11 GMT 2024

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

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

Back to the top