How to have multicolored tree label [message #327449] |
Sun, 20 April 2008 21:01  |
Eclipse User |
|
|
|
Hi in 3.4M6 the tree labels in the Package explorer, and Outline shows
examples where the label is multicolored. E.g. a method is rendered in
the Outline view with black method name, and then the type i gold.
How is this effect created? Greatful if someone can point me to an
example (or how/where to find code that does this).
Regards
- henrik
|
|
|
|
|
Re: How to have multicolored tree label [message #327477 is a reply to message #327464] |
Mon, 21 April 2008 17:33   |
Eclipse User |
|
|
|
Hi,
Where do you read something about deprecate in the snippet? Running the
snippet does exactly what you want to it shows a table with a
multi-color label (black and blue).
ViewerCell is the widget independent representation of a Cell in your
viewer. It allows you to set an image, text, ... on the underlying
SWT-Item (TreeItem, TableItem, ...).
Tom
Henrik Lindberg schrieb:
> Thanks Tom,
> A couple of follow up questions - the SimpleStyledCellLabelProvider is
> marked as deprecated and a different label provider is suggested
> StyledCellLabelProvider, and it is quite different.
>
> I have not worked with ViwerCell's before - so I don't get the info
> in the JavaDoc for that class -
>
> * For providing the label's styles, create a subclass and overwrite
> * {@link StyledCellLabelProvider#update(ViewerCell)} to
> * return set all information needed to render a element. Use
> * {@link ViewerCell#setStyleRanges(StyleRange[])} to set style ranges
> * on the label.
>
> Any pointers to example use of SimpleStyledCellLabelProvider, or to
> information about ViewerCell?
>
> Basically, all I want to do is to have a multicolored label in a
> TreeViewer (no need for columns, etc). Any Suggestions?
>
> Regards
> - henrik
>
>
> Tom Schindl wrote:
>> http://wiki.eclipse.org/JFaceSnippets#Snippet049SimpleStyled CellLabelProvider
>>
>>
>> Tom
>>
>> Henrik Lindberg schrieb:
>>> Hi in 3.4M6 the tree labels in the Package explorer, and Outline
>>> shows examples where the label is multicolored. E.g. a method is
>>> rendered in the Outline view with black method name, and then the
>>> type i gold.
>>>
>>> How is this effect created? Greatful if someone can point me to an
>>> example (or how/where to find code that does this).
>>>
>>> Regards
>>> - henrik
>>
>>
--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
|
|
|
Re: How to have multicolored tree label [message #327500 is a reply to message #327464] |
Tue, 22 April 2008 10:43   |
Eclipse User |
|
|
|
Have a look at the wiki page again. We did update the snippets (they now use
StyledCellLabelProvider instead of SimpleStyledCellLabelProvider), but
because of a "feature" in ViewCVS, you were still seeing the old snippets.
Boris
"Henrik Lindberg" <henrik.lindberg@cloudsmith.com> wrote in message
news:fuij19$d3n$1@build.eclipse.org...
> Thanks Tom,
> A couple of follow up questions - the SimpleStyledCellLabelProvider is
> marked as deprecated and a different label provider is suggested
> StyledCellLabelProvider, and it is quite different.
>
> I have not worked with ViwerCell's before - so I don't get the info
> in the JavaDoc for that class -
>
> * For providing the label's styles, create a subclass and overwrite
> * {@link StyledCellLabelProvider#update(ViewerCell)} to
> * return set all information needed to render a element. Use
> * {@link ViewerCell#setStyleRanges(StyleRange[])} to set style ranges
> * on the label.
>
> Any pointers to example use of SimpleStyledCellLabelProvider, or to
> information about ViewerCell?
>
> Basically, all I want to do is to have a multicolored label in a
> TreeViewer (no need for columns, etc). Any Suggestions?
>
> Regards
> - henrik
>
>
> Tom Schindl wrote:
>> http://wiki.eclipse.org/JFaceSnippets#Snippet049SimpleStyled CellLabelProvider
>> Tom
>>
>> Henrik Lindberg schrieb:
>>> Hi in 3.4M6 the tree labels in the Package explorer, and Outline shows
>>> examples where the label is multicolored. E.g. a method is rendered in
>>> the Outline view with black method name, and then the type i gold.
>>>
>>> How is this effect created? Greatful if someone can point me to an
>>> example (or how/where to find code that does this).
>>>
>>> Regards
>>> - henrik
>>
|
|
|
|
Powered by
FUDForum. Page generated in 0.09372 seconds