[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.swt] Re: Displaying URL in TableViewer
|
If you want to put a control into your Table then a Link seems like a better
choice for this than StyledText. For an example of this (with a
ProgressBar) see
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet149.java .
Grant
"Vivian" <Vivian.Nguyen@xxxxxxxxxxxxxxxxxxx> wrote in message
news:bb17ef9bdbcd65860ec5b37dcda03003$1@xxxxxxxxxxxxxxxxxx
> Thanks Tom,
> I've got it working, sort of. The mouse click events aren't always
> received and interpreted correctly. E.g. I try to single click the URL,
> but the table will intepreted as selection event and thus selects the
> whole row, instead of acting on the request to display the webpage.
>
> Is there a way to "embed" (for the lack of a better word atm) a StyledText
> into a table cell?
>
> Tom Schindl wrote:
>
> > - Blue not a problem use
> > 3.3: ColumnViewerLabelProvider#getForegroundColor(Object)
> > 3.2: ITableColorLabelProvider#getForegroundColor(int,Object)
>
> > - Clickable, I'd simply add a MouseListener on the table and check if
> > tht click is done on the cell with the URL
>
> > - Underline is bit harder because you'd need OwnerDraw and in 3.3 you
> > have write everything your own. In 3.4 we added support for styled text.
>
> > Example found here:
> > http://wiki.eclipse.org/JFaceSnippets
> >
>
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java?view=markup
>
> > Tom
>
> > Vivian schrieb:
> >> Hi Tom,
> >> Yes, I would like to know if there is a way of rendering a URL in a
> >> table (blue, underlined) and be able to open it by single-clicking.
Thanks.
> >>
>
>
>
>