<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chocolate and Bits</title>
	<atom:link href="http://davymeers.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://davymeers.net</link>
	<description>The blog of a belgian Software Engineer</description>
	<lastBuildDate>Thu, 29 Jul 2010 14:06:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>How to add both an image decoration and a custom tooltip to a JFace ViewerColumn</title>
		<link>http://davymeers.net/2010/07/04/jface-using-columnviewers-combined-with-decoration-and-custom-tooltips/</link>
		<comments>http://davymeers.net/2010/07/04/jface-using-columnviewers-combined-with-decoration-and-custom-tooltips/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 13:03:38 +0000</pubDate>
		<dc:creator>mudelta</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JFace]]></category>
		<category><![CDATA[RCP]]></category>
		<category><![CDATA[SWT]]></category>

		<guid isPermaLink="false">http://davymeers.net/?p=27</guid>
		<description><![CDATA[Recently i had to add some image decorations and a custom tooltip to a column of a Jface StructuredViewer. This wasn&#8217;t too hard, but i lost a fair amount of time figuring out how to put the pieces together. This is how i did it: Setup To avoid unneeded elements i&#8217;ll start with a plug-in [...]]]></description>
			<content:encoded><![CDATA[<p>Recently i had to add some image decorations and a custom tooltip to a column of a Jface StructuredViewer. This wasn&#8217;t too hard, but i lost a fair amount of time figuring out how to put the pieces together.</p>
<p>This is how i did it:</p>
<p><span id="more-27"></span></p>
<h3>Setup</h3>
<p>To avoid unneeded elements i&#8217;ll start with a plug-in project created with the eclipse wizard &#8220;RCP application with a view&#8221;.</p>
<p>When you run the application created by the wizard you will get the following:</p>
<div id="attachment_58" class="wp-caption aligncenter" style="width: 310px"><a href="http://davymeers.net/blog/wp-content/uploads/2010/07/cleanRcpApplication.png"><img src="http://davymeers.net/blog/wp-content/uploads/2010/07/cleanRcpApplication-300x225.png" alt="RCP application generated by the eclipse wizard" title="RCP application generated by the eclipse wizard" width="300" height="225" class="size-medium wp-image-58" /></a><p class="wp-caption-text">RCP application generated by the eclipse wizard</p></div>
<p>Unfortunately the generated view doesn&#8217;t use viewercolumns, so we have to change that:</p>
<h4>Adapting the generated view</h4>
<h5>Change ViewLabelProvider</h5>
<p>Since the ViewerColumn accepts only a CellLabelProvider change the ViewLabelProvider to the following:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> ViewLabelProvider <span style="color: #000000; font-weight: bold;">extends</span> ColumnLabelProvider <span style="color: #009900;">&#123;</span>
    @<span style="color: #003399; font-weight: bold;">Override</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @<span style="color: #003399; font-weight: bold;">Override</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Image</span> getImage<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> PlatformUI.<span style="color: #006633;">getWorkbench</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getSharedImages</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getImage</span><span style="color: #009900;">&#40;</span>
                ISharedImages.<span style="color: #006633;">IMG_OBJ_ELEMENT</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h5>Change method createPartControl(Composite parent)</h5>
<p>we need to create a ViewerColumn and add the labelprovider to it.</p>
<p>To make sure the column takes the whole width of the table, we use the <a href="http://blog.eclipse-tips.com/2008/05/single-column-tableviewer-and.html" target="_blank">TableColumnLayout</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/**
* This is a callback that will allow us to create the viewer and initialize
* it.
*/</span>
@<span style="color: #003399; font-weight: bold;">Override</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> createPartControl<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Composite</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	viewer = <span style="color: #000000; font-weight: bold;">new</span> TableViewer<span style="color: #009900;">&#40;</span>parent, SWT.<span style="color: #006633;">MULTI</span> | SWT.<span style="color: #006633;">H_SCROLL</span>
	        | SWT.<span style="color: #006633;">V_SCROLL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	TableViewerColumn viewerColumn = <span style="color: #000000; font-weight: bold;">new</span> TableViewerColumn<span style="color: #009900;">&#40;</span>viewer, SWT.<span style="color: #006633;">NONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	viewerColumn.<span style="color: #006633;">setLabelProvider</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ViewLabelProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	TableColumnLayout tableColumnLayout = <span style="color: #000000; font-weight: bold;">new</span> TableColumnLayout<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	tableColumnLayout.<span style="color: #006633;">setColumnData</span><span style="color: #009900;">&#40;</span>viewerColumn.<span style="color: #006633;">getColumn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
	        <span style="color: #000000; font-weight: bold;">new</span> ColumnWeightData<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	parent.<span style="color: #006633;">setLayout</span><span style="color: #009900;">&#40;</span>tableColumnLayout<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	viewer.<span style="color: #006633;">setContentProvider</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ViewContentProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	viewer.<span style="color: #006633;">setInput</span><span style="color: #009900;">&#40;</span>getViewSite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Generating a model</h4>
<p>The model is going to be used later on, to decide wether to decorate or not.</p>
<h5>Create the model class</h5>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> ViewModel <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #006600; font-weight: bold;">boolean</span> active = <span style="color: #006600; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399; font-weight: bold;">String</span> name<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">name</span> = name<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> name, <span style="color: #006600; font-weight: bold;">boolean</span> active<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span>name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">active</span> = active<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> isActive<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> active<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> name<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h5>Adapt the labelprovider</h5>
<p>Change the method getText(Object obj).</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">@<span style="color: #003399; font-weight: bold;">Override</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>obj <span style="color: #000000; font-weight: bold;">instanceof</span> ViewModel<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		ViewModel viewModel = <span style="color: #009900;">&#40;</span>ViewModel<span style="color: #009900;">&#41;</span> obj<span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> viewModel.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h5>Adapt the contentprovider</h5>
<p>Change the method getElements(Object parent).</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> getElements<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> ViewModel<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">new</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;One&quot;</span>, <span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>,
	        <span style="color: #000000; font-weight: bold;">new</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Two&quot;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Three&quot;</span>, <span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>Adding decorations</h3>
<p>We are going to use the DecoratingStyledCellLabelProvider to add decorations.</p>
<p>The DecoratingStyledCellLabelProvider needs a ILabelDecorator and a IStyledLabelProvider.</p>
<h4>Creating a labelDecorator</h4>
<p>We only want to decorate the image, therefore we implement the method decorateImage(Image image, Object element, IDecorationContext context and the method dispose (to dispose the generated image).</p>
<p>It would be nice though if there existed a LabelDecoratorAdapter in JFace so we didn&#8217;t have to add the other methods.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> ViewLabelDecorator <span style="color: #000000; font-weight: bold;">extends</span> LabelDecorator <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> ImageDescriptor warningImageDescriptor = <span style="color: #003399; font-weight: bold;">Activator</span>
	        .<span style="color: #006633;">getImageDescriptor</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;icons/bullet_error.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399; font-weight: bold;">Image</span> decoratedImage = <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Image</span> decorateImage<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Image</span> image, <span style="color: #003399; font-weight: bold;">Object</span> element, IDecorationContext context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>element <span style="color: #000000; font-weight: bold;">instanceof</span> ViewModel <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>ViewModel<span style="color: #009900;">&#41;</span> element<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isActive</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>decoratedImage == <span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				decoratedImage = <span style="color: #000000; font-weight: bold;">new</span> DecorationOverlayIcon<span style="color: #009900;">&#40;</span>image, warningImageDescriptor, IDecoration.<span style="color: #006633;">BOTTOM_RIGHT</span><span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">createImage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> decoratedImage<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> dispose<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		decoratedImage.<span style="color: #006633;">dispose</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		decoratedImage = <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> decorateText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> text, <span style="color: #003399; font-weight: bold;">Object</span> element,
	        IDecorationContext context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> prepareDecoration<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element, <span style="color: #003399; font-weight: bold;">String</span> originalText,
	        IDecorationContext context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Image</span> decorateImage<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Image</span> image, <span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> decorateText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> text, <span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> addListener<span style="color: #009900;">&#40;</span>ILabelProviderListener listener<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> isLabelProperty<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element, <span style="color: #003399; font-weight: bold;">String</span> property<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> removeListener<span style="color: #009900;">&#40;</span>ILabelProviderListener listener<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Adapting the labelProvider</h4>
<p>We need to make the LabelProvider implement the interface IStyledLabelProvider.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> ViewLabelProvider <span style="color: #000000; font-weight: bold;">extends</span> ColumnLabelProvider <span style="color: #000000; font-weight: bold;">implements</span>
        IStyledLabelProvider <span style="color: #009900;">&#123;</span>
	.....
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> StyledString getStyledText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> StyledString<span style="color: #009900;">&#40;</span>getText<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Using the DecoratingStyledCellLabelProvider</h4>
<p>Change the method createPartControl(Composite parent) of the view as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">@<span style="color: #003399; font-weight: bold;">Override</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> createPartControl<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Composite</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	.....
&nbsp;
	<span style="color: #006633;">TableViewerColumn</span> viewerColumn = <span style="color: #000000; font-weight: bold;">new</span> TableViewerColumn<span style="color: #009900;">&#40;</span>viewer, SWT.<span style="color: #006633;">NONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	viewerColumn.<span style="color: #006633;">setLabelProvider</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> DecoratingStyledCellLabelProvider<span style="color: #009900;">&#40;</span>
	        <span style="color: #000000; font-weight: bold;">new</span> ViewLabelProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> ViewLabelDecorator<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	.....
&nbsp;
	<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Result</h4>
<p>When you run the application now you will get the following:</p>
<div id="attachment_103" class="wp-caption aligncenter" style="width: 310px"><a href="http://davymeers.net/blog/wp-content/uploads/2010/07/decoratedRcpApplication.png"><img src="http://davymeers.net/blog/wp-content/uploads/2010/07/decoratedRcpApplication-300x225.png" alt="decorated RCP application" title="decorated RCP application" width="300" height="225" class="size-medium wp-image-103" /></a><p class="wp-caption-text">decorated RCP application</p></div>
<h3>Adding tooltips</h3>
<p>Adding tooltips is a two-step process: the CellabelProvider provides methods for tooltips that we can implement, and by using the ColumnViewerToolTipSupport we have tooltips. Well, that would it be if the DelegatingStyledCellLabelProvider would try to delegate all the methods.</p>
<p> It seems that <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=236006" target="_blank">the DelegatingStyledCellLabelProvider has support for IFontProvider and IColorProvider but not for tooltip methods defined in CellLabelProvider</a>.</p>
<h4>Adapting the labelprovider</h4>
<p>Implement the method getTooltipText(Object element):</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">@<span style="color: #003399; font-weight: bold;">Override</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getToolTipText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">return</span> getText<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span> + <span style="color: #0000ff;">&quot;, shown in a tooltip&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Extend the DecoratingStyledCellLabelProvider</h4>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> ViewDecoratingStyledCellLabelProvider <span style="color: #000000; font-weight: bold;">extends</span>
        DecoratingStyledCellLabelProvider <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> IStyledLabelProvider labelProvider<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> ViewDecoratingStyledCellLabelProvider<span style="color: #009900;">&#40;</span>
	        IStyledLabelProvider labelProvider, ILabelDecorator decorator,
	        IDecorationContext decorationContext<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>labelProvider, decorator, decorationContext<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">labelProvider</span> = labelProvider<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Color</span> getToolTipBackgroundColor<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipBackgroundColor</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipBackgroundColor</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">int</span> getToolTipDisplayDelayTime<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipDisplayDelayTime</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipDisplayDelayTime</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Font</span> getToolTipFont<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipFont</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipFont</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Color</span> getToolTipForegroundColor<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipForegroundColor</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipForegroundColor</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Image</span> getToolTipImage<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipImage</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipImage</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Point</span> getToolTipShift<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipShift</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipShift</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">int</span> getToolTipStyle<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipStyle</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipStyle</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getToolTipText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipText</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipText</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">int</span> getToolTipTimeDisplayed<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">getToolTipTimeDisplayed</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipTimeDisplayed</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> useNativeToolTip<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
			        .<span style="color: #006633;">useNativeToolTip</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">useNativeToolTip</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Enabling the tooltips</h4>
<p>Change the method createPartControl(Composite parent) of the view as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">@<span style="color: #003399; font-weight: bold;">Override</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> createPartControl<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Composite</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	.....
&nbsp;
	<span style="color: #006633;">viewerColumn</span>
	        .<span style="color: #006633;">setLabelProvider</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ViewDecoratingStyledCellLabelProvider<span style="color: #009900;">&#40;</span>
	                <span style="color: #000000; font-weight: bold;">new</span> ViewLabelProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> ViewLabelDecorator<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	.....
&nbsp;
	<span style="color: #006633;">viewer</span>.<span style="color: #006633;">setInput</span><span style="color: #009900;">&#40;</span>getViewSite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	ColumnViewerToolTipSupport.<span style="color: #006633;">enableFor</span><span style="color: #009900;">&#40;</span>viewer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Result</h4>
<p>When you run the application now you will get the following:</p>
<div id="attachment_113" class="wp-caption aligncenter" style="width: 310px"><a href="http://davymeers.net/blog/wp-content/uploads/2010/07/decoratedRcpApplicationWithTooltip.png"><img src="http://davymeers.net/blog/wp-content/uploads/2010/07/decoratedRcpApplicationWithTooltip-300x225.png" alt="decorated RCP application with tooltip" title="decorated RCP application with tooltip" width="300" height="225" class="size-medium wp-image-113" /></a><p class="wp-caption-text">decorated RCP application with tooltip</p></div>
<h3>Custom tooltips</h3>
<p>By extending the ColumnViewerToolTipSupport it is possible to provide custom tooltips.</p>
<h4>Extending ColumnViewerToolTipSupport</h4>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> ViewColumnViewerToolTipSupport <span style="color: #000000; font-weight: bold;">extends</span>
        ColumnViewerToolTipSupport <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">protected</span> ViewColumnViewerToolTipSupport<span style="color: #009900;">&#40;</span>ColumnViewer viewer,
	        <span style="color: #006600; font-weight: bold;">int</span> style, <span style="color: #006600; font-weight: bold;">boolean</span> manualActivation<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>viewer, style, manualActivation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #003399; font-weight: bold;">Composite</span> createViewerToolTipContentArea<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Event</span> event,
	        ViewerCell cell, <span style="color: #003399; font-weight: bold;">Composite</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399; font-weight: bold;">Composite</span> composite = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Composite</span><span style="color: #009900;">&#40;</span>parent, SWT.<span style="color: #006633;">NONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		composite.<span style="color: #006633;">setLayout</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> RowLayout<span style="color: #009900;">&#40;</span>SWT.<span style="color: #006633;">VERTICAL</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #003399; font-weight: bold;">Text</span> text = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Text</span><span style="color: #009900;">&#40;</span>composite, SWT.<span style="color: #006633;">SINGLE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		text.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>getText<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		text.<span style="color: #006633;">setSize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		DateTime calendar = <span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span>composite, SWT.<span style="color: #006633;">CALENDAR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		calendar.<span style="color: #006633;">setEnabled</span><span style="color: #009900;">&#40;</span><span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		calendar.<span style="color: #006633;">setSize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		composite.<span style="color: #006633;">pack</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> composite<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #006600; font-weight: bold;">void</span> enableFor<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> ColumnViewer viewer<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">new</span> ViewColumnViewerToolTipSupport<span style="color: #009900;">&#40;</span>viewer, ToolTip.<span style="color: #006633;">NO_RECREATE</span>,
		        <span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Using the ViewColumnViewerToolTipSupport</h4>
<p>Change the method createPartControl(Composite parent) of the view as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;">@<span style="color: #003399; font-weight: bold;">Override</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> createPartControl<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Composite</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	.....
&nbsp;
	<span style="color: #006633;">ViewColumnViewerToolTipSupport</span>.<span style="color: #006633;">enableFor</span><span style="color: #009900;">&#40;</span>viewer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h4>Result</h4>
<p>When you run the application now you will get the following:</p>
<div id="attachment_117" class="wp-caption aligncenter" style="width: 310px"><a href="http://davymeers.net/blog/wp-content/uploads/2010/07/decoratedRcpApplicationWithCustomTooltip.png"><img src="http://davymeers.net/blog/wp-content/uploads/2010/07/decoratedRcpApplicationWithCustomTooltip-300x225.png" alt="decorated RCP application with custom tooltip" title="decorated RCP application with custom tooltip" width="300" height="225" class="size-medium wp-image-117" /></a><p class="wp-caption-text">decorated RCP application with custom tooltip</p></div>
<h3>Source code</h3>
<p>Following is the view class. For simplicity i added all classes as internal class to the generated view class. Make sure the image &#8220;icons/bullet_error.png&#8221;exists.</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">net.davymeers.examples.jface.columnviewerdecorationandtooltip.internal</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.layout.TableColumnLayout</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.resource.ImageDescriptor</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.CellLabelProvider</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.ColumnLabelProvider</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.ColumnViewer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.ColumnViewerToolTipSupport</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.ColumnWeightData</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.DecoratingStyledCellLabelProvider</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.DecorationOverlayIcon</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.IDecoration</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.IDecorationContext</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.ILabelDecorator</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.ILabelProviderListener</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.IStructuredContentProvider</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.LabelDecorator</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.StyledString</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.TableViewer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.TableViewerColumn</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.Viewer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.ViewerCell</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.jface.window.ToolTip</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.SWT</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.graphics.Color</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.graphics.Font</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.graphics.Image</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.graphics.Point</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.layout.RowLayout</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.widgets.Composite</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.widgets.DateTime</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.widgets.Event</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.swt.widgets.Text</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.ui.ISharedImages</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.ui.PlatformUI</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.eclipse.ui.part.ViewPart</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> <span style="color: #003399; font-weight: bold;">View</span> <span style="color: #000000; font-weight: bold;">extends</span> ViewPart <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399; font-weight: bold;">String</span> ID = <span style="color: #0000ff;">&quot;net.davymeers.examples.jface.columnviewerDecorationAndTooltip.view&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> TableViewer viewer<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * The content provider class is responsible for providing objects to the
	 * view. It can wrap existing objects in adapters or simply return objects
	 * as-is. These objects may be sensitive to the current input of the view,
	 * or ignore it and always show the same content (like Task List, for
	 * example).
	 */</span>
	<span style="color: #000000; font-weight: bold;">class</span> ViewContentProvider <span style="color: #000000; font-weight: bold;">implements</span> IStructuredContentProvider <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> inputChanged<span style="color: #009900;">&#40;</span>Viewer v, <span style="color: #003399; font-weight: bold;">Object</span> oldInput, <span style="color: #003399; font-weight: bold;">Object</span> newInput<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> dispose<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Object</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> getElements<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> ViewModel<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">new</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;One&quot;</span>, <span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>,
			        <span style="color: #000000; font-weight: bold;">new</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Two&quot;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Three&quot;</span>, <span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">class</span> ViewLabelProvider <span style="color: #000000; font-weight: bold;">extends</span> ColumnLabelProvider <span style="color: #000000; font-weight: bold;">implements</span>
	        IStyledLabelProvider <span style="color: #009900;">&#123;</span>
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>obj <span style="color: #000000; font-weight: bold;">instanceof</span> ViewModel<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				ViewModel viewModel = <span style="color: #009900;">&#40;</span>ViewModel<span style="color: #009900;">&#41;</span> obj<span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">return</span> viewModel.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getText</span><span style="color: #009900;">&#40;</span>obj<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Image</span> getImage<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> obj<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> PlatformUI.<span style="color: #006633;">getWorkbench</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getSharedImages</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getImage</span><span style="color: #009900;">&#40;</span>
			        ISharedImages.<span style="color: #006633;">IMG_OBJ_ELEMENT</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> StyledString getStyledText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> StyledString<span style="color: #009900;">&#40;</span>getText<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getToolTipText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> getText<span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span> + <span style="color: #0000ff;">&quot;, shown in a tooltip&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">class</span> ViewModel <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #006600; font-weight: bold;">boolean</span> active = <span style="color: #006600; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399; font-weight: bold;">String</span> name<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">name</span> = name<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">protected</span> ViewModel<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> name, <span style="color: #006600; font-weight: bold;">boolean</span> active<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span>name<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">active</span> = active<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> isActive<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> active<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> name<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">class</span> ViewLabelDecorator <span style="color: #000000; font-weight: bold;">extends</span> LabelDecorator <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> ImageDescriptor warningImageDescriptor = <span style="color: #003399; font-weight: bold;">Activator</span>
		        .<span style="color: #006633;">getImageDescriptor</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;icons/bullet_error.png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399; font-weight: bold;">Image</span> decoratedImage = <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Image</span> decorateImage<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Image</span> image, <span style="color: #003399; font-weight: bold;">Object</span> element,
		        IDecorationContext context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>element <span style="color: #000000; font-weight: bold;">instanceof</span> ViewModel
			        <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>ViewModel<span style="color: #009900;">&#41;</span> element<span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isActive</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>decoratedImage == <span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					decoratedImage = <span style="color: #000000; font-weight: bold;">new</span> DecorationOverlayIcon<span style="color: #009900;">&#40;</span>image,
					        warningImageDescriptor, IDecoration.<span style="color: #006633;">BOTTOM_RIGHT</span><span style="color: #009900;">&#41;</span>
					        .<span style="color: #006633;">createImage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
				<span style="color: #000000; font-weight: bold;">return</span> decoratedImage<span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> dispose<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			decoratedImage.<span style="color: #006633;">dispose</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			decoratedImage = <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> decorateText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> text, <span style="color: #003399; font-weight: bold;">Object</span> element,
		        IDecorationContext context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> prepareDecoration<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element, <span style="color: #003399; font-weight: bold;">String</span> originalText,
		        IDecorationContext context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Image</span> decorateImage<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Image</span> image, <span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> decorateText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> text, <span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> addListener<span style="color: #009900;">&#40;</span>ILabelProviderListener listener<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> isLabelProperty<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element, <span style="color: #003399; font-weight: bold;">String</span> property<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #006600; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> removeListener<span style="color: #009900;">&#40;</span>ILabelProviderListener listener<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">class</span> ViewDecoratingStyledCellLabelProvider <span style="color: #000000; font-weight: bold;">extends</span>
	        DecoratingStyledCellLabelProvider <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> IStyledLabelProvider labelProvider<span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> ViewDecoratingStyledCellLabelProvider<span style="color: #009900;">&#40;</span>
		        IStyledLabelProvider labelProvider, ILabelDecorator decorator,
		        IDecorationContext decorationContext<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>labelProvider, decorator, decorationContext<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">labelProvider</span> = labelProvider<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Color</span> getToolTipBackgroundColor<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipBackgroundColor</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipBackgroundColor</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">int</span> getToolTipDisplayDelayTime<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipDisplayDelayTime</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipDisplayDelayTime</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Font</span> getToolTipFont<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipFont</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipFont</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Color</span> getToolTipForegroundColor<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipForegroundColor</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipForegroundColor</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Image</span> getToolTipImage<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipImage</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipImage</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">Point</span> getToolTipShift<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipShift</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipShift</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">int</span> getToolTipStyle<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipStyle</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipStyle</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> getToolTipText<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipText</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipText</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">int</span> getToolTipTimeDisplayed<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">getToolTipTimeDisplayed</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">getToolTipTimeDisplayed</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">boolean</span> useNativeToolTip<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Object</span> object<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>labelProvider <span style="color: #000000; font-weight: bold;">instanceof</span> CellLabelProvider<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>CellLabelProvider<span style="color: #009900;">&#41;</span> labelProvider<span style="color: #009900;">&#41;</span>
				        .<span style="color: #006633;">useNativeToolTip</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">useNativeToolTip</span><span style="color: #009900;">&#40;</span>object<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> ViewColumnViewerToolTipSupport <span style="color: #000000; font-weight: bold;">extends</span>
	        ColumnViewerToolTipSupport <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">protected</span> ViewColumnViewerToolTipSupport<span style="color: #009900;">&#40;</span>ColumnViewer viewer,
		        <span style="color: #006600; font-weight: bold;">int</span> style, <span style="color: #006600; font-weight: bold;">boolean</span> manualActivation<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span>viewer, style, manualActivation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		@<span style="color: #003399; font-weight: bold;">Override</span>
		<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #003399; font-weight: bold;">Composite</span> createViewerToolTipContentArea<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Event</span> event,
		        ViewerCell cell, <span style="color: #003399; font-weight: bold;">Composite</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">final</span> <span style="color: #003399; font-weight: bold;">Composite</span> composite = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Composite</span><span style="color: #009900;">&#40;</span>parent, SWT.<span style="color: #006633;">NONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			composite.<span style="color: #006633;">setLayout</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> RowLayout<span style="color: #009900;">&#40;</span>SWT.<span style="color: #006633;">VERTICAL</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #003399; font-weight: bold;">Text</span> text = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">Text</span><span style="color: #009900;">&#40;</span>composite, SWT.<span style="color: #006633;">SINGLE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			text.<span style="color: #006633;">setText</span><span style="color: #009900;">&#40;</span>getText<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			text.<span style="color: #006633;">setSize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			DateTime calendar = <span style="color: #000000; font-weight: bold;">new</span> DateTime<span style="color: #009900;">&#40;</span>composite, SWT.<span style="color: #006633;">CALENDAR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			calendar.<span style="color: #006633;">setEnabled</span><span style="color: #009900;">&#40;</span><span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			calendar.<span style="color: #006633;">setSize</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			composite.<span style="color: #006633;">pack</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">return</span> composite<span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #006600; font-weight: bold;">void</span> enableFor<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> ColumnViewer viewer<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">new</span> ViewColumnViewerToolTipSupport<span style="color: #009900;">&#40;</span>viewer, ToolTip.<span style="color: #006633;">NO_RECREATE</span>,
			        <span style="color: #006600; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * This is a callback that will allow us to create the viewer and initialize
	 * it.
	 */</span>
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> createPartControl<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">Composite</span> parent<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		viewer = <span style="color: #000000; font-weight: bold;">new</span> TableViewer<span style="color: #009900;">&#40;</span>parent, SWT.<span style="color: #006633;">MULTI</span> | SWT.<span style="color: #006633;">H_SCROLL</span>
		        | SWT.<span style="color: #006633;">V_SCROLL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		TableViewerColumn viewerColumn = <span style="color: #000000; font-weight: bold;">new</span> TableViewerColumn<span style="color: #009900;">&#40;</span>viewer, SWT.<span style="color: #006633;">NONE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		viewerColumn
		        .<span style="color: #006633;">setLabelProvider</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ViewDecoratingStyledCellLabelProvider<span style="color: #009900;">&#40;</span>
		                <span style="color: #000000; font-weight: bold;">new</span> ViewLabelProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000000; font-weight: bold;">new</span> ViewLabelDecorator<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		TableColumnLayout tableColumnLayout = <span style="color: #000000; font-weight: bold;">new</span> TableColumnLayout<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		tableColumnLayout.<span style="color: #006633;">setColumnData</span><span style="color: #009900;">&#40;</span>viewerColumn.<span style="color: #006633;">getColumn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
		        <span style="color: #000000; font-weight: bold;">new</span> ColumnWeightData<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		parent.<span style="color: #006633;">setLayout</span><span style="color: #009900;">&#40;</span>tableColumnLayout<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		viewer.<span style="color: #006633;">setContentProvider</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ViewContentProvider<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		viewer.<span style="color: #006633;">setInput</span><span style="color: #009900;">&#40;</span>getViewSite<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		ViewColumnViewerToolTipSupport.<span style="color: #006633;">enableFor</span><span style="color: #009900;">&#40;</span>viewer<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Passing the focus request to the viewer's control.
	 */</span>
	@<span style="color: #003399; font-weight: bold;">Override</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> setFocus<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		viewer.<span style="color: #006633;">getControl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">setFocus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://davymeers.net/2010/07/04/jface-using-columnviewers-combined-with-decoration-and-custom-tooltips/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://davymeers.net/2010/07/03/welcome/</link>
		<comments>http://davymeers.net/2010/07/03/welcome/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 15:43:37 +0000</pubDate>
		<dc:creator>mudelta</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://davymeers.net/blog/?p=18</guid>
		<description><![CDATA[Hello and welcome on my blog, Frequently i find myself looking for information about a problem i&#8217;m having and when that information is scarse it can take some time to find the solution. My main goal of this blog is to share the solutions i come up with to help others. Since i&#8217;m encountering most [...]]]></description>
			<content:encoded><![CDATA[<p>Hello and welcome on my blog,</p>
<p>Frequently i find myself looking for information about a problem i&#8217;m having and when that information is scarse it can take some time to find the solution.<br />
My main goal of this blog is to share the solutions i come up with to help others.</p>
<p>Since i&#8217;m encountering most of those problems with technologies i am pretty unexperienced in, some of you might know a better solution or might notice some mistakes i make (or violations to best practices).</p>
<p>Don&#8217;t hesitate to let me know if that happens.</p>
]]></content:encoded>
			<wfw:commentRss>http://davymeers.net/2010/07/03/welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

