0
votes

I've created an (empty until now) View in my Eclipse Plugin. I'm also using Eclipse Cloudio. This library provides the following object (description taken from the linked site):

A TagCloud is a special org.eclipse.swt.widgets.Canvas, dedicated to display a tag cloud.

Basically it's an image showing a WordCloud. Now there are snippets on the site on how to show such TagClouds in a shell / popup.

But I'd like to show them in a view (this function is supposed to be used often and I think it's bad style to spam popup-windows).

What I do not know tho is how to set this TagCloud (which is a Canvas) to the View / make the View display the Canvas. Maybe someone can help me with this?

Edit: gregs Answer works like a charm! It just needs another setWords() function which is called from where-ever which contains .setWords to set the words when neccessary.

1
Did you read the Creating an Eclipse View article? Though it is old, the core concepts are still valid (just ignore Step1).Rüdiger Herrmann

1 Answers

1
votes

You just need to add the control to the view in the view createPartControl. At the simplest that would be:

@Override
public void createPartControl(final Composite parent)
{
  TagCloud cloud = new TagCloud(parent, SWT.NONE);

  ... set up the cloud as in the example
}