[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: how to add formatted text in a table cell.

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.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/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@xxxxxxxxx <mailto:deeptisuri124@xxxxxxxxx>> wrote in message news:frnta3$us1$1@xxxxxxxxxxxxxxxxxxxx
> 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
--------------------------------------------------------------------