public class TagCloudViewer extends ContentViewer
TagCloud.WIDGET_DATA_KEY| Constructor and Description |
|---|
TagCloudViewer(TagCloud cloud)
Create a new TagCloudViewer for the given
TagCloud, which must
not be null. |
| Modifier and Type | Method and Description |
|---|---|
TagCloud |
getCloud()
Returns the
TagCloud managed by this viewer. |
Control |
getControl() |
ILayouter |
getLayouter() |
int |
getMaxWords()
Returns the maximum number of elements which will be displayed by the
cloud.
|
ISelection |
getSelection()
Returns the currently selected elements, as an
IStructuredSelection. |
protected void |
initListeners()
Initialize the default tag cloud listeners.
|
protected void |
initMouseWheelListener()
Initialize the mouse wheel listener to support zooming in and out.
|
protected void |
initSelectionListener()
Initialize default selection behaviour: Words can be selected by mouse
click, and selection listeners are notified when the selection changed.
|
protected void |
initToolTipSupport()
Initialize tool tip support when the cursor hovers a word.
|
protected void |
inputChanged(java.lang.Object input,
java.lang.Object oldInput) |
void |
refresh() |
void |
reset(IProgressMonitor monitor,
boolean recalc)
Resets the
TagCloud. |
void |
setBoost(int boost) |
void |
setBoostFactor(float boostFactor) |
void |
setContentProvider(IContentProvider contentProvider)
Sets the content provider of this viewer, which must be an
IStructuredContentProvider. |
void |
setInput(java.lang.Object input,
IProgressMonitor progressMonitor)
Same as
ContentViewer.setInput(Object), but with an
IProgressMonitor to provide feedback during the layout phase. |
void |
setLabelProvider(IBaseLabelProvider labelProvider)
Sets the label provider of this viewer, which must be an
ICloudLabelProvider. |
void |
setLayouter(ILayouter layouter) |
void |
setMaxWords(int words)
Sets the maximum number of elements which will be displayed by the cloud.
|
void |
setSelection(ISelection selection,
boolean reveal) |
void |
zoomFit()
Calls
TagCloud.zoomFit() to scale the cloud such that it fits the
current visible area. |
void |
zoomIn()
Zooms in
|
void |
zoomOut()
Zooms out
|
void |
zoomReset()
Resets the zoom to 100%
|
getContentProvider, getInput, getLabelProvider, handleDispose, handleLabelProviderChanged, hookControl, labelProviderChanged, setInputaddHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelectionprotected void initListeners()
protected void initToolTipSupport()
protected void initMouseWheelListener()
protected void initSelectionListener()
public Control getControl()
getControl in class Viewerpublic ISelection getSelection()
IStructuredSelection. Returns an empty selection if no elements
are selected.getSelection in interface ISelectionProvidergetSelection in class Viewerpublic void setSelection(ISelection selection, boolean reveal)
setSelection in class Viewerpublic void reset(IProgressMonitor monitor, boolean recalc)
TagCloud. If recalc is true,
the displayed elements will be updated with the values provided by the used
ICloudLabelProvider. Otherwise, the cloud will only be
re-layouted, keeping fonts, colors and angles untouched.monitor - recalc - public TagCloud getCloud()
TagCloud managed by this viewer.TagCloud of this viewerpublic void setLabelProvider(IBaseLabelProvider labelProvider)
ICloudLabelProvider.setLabelProvider in class ContentViewerpublic void setContentProvider(IContentProvider contentProvider)
IStructuredContentProvider.setContentProvider in class ContentViewerprotected void inputChanged(java.lang.Object input,
java.lang.Object oldInput)
inputChanged in class Viewerpublic void setMaxWords(int words)
public void zoomFit()
TagCloud.zoomFit() to scale the cloud such that it fits the
current visible area.public void zoomIn()
public void zoomOut()
public void zoomReset()
public void setBoost(int boost)
public int getMaxWords()
public void setInput(java.lang.Object input,
IProgressMonitor progressMonitor)
ContentViewer.setInput(Object), but with an
IProgressMonitor to provide feedback during the layout phase.input - progressMonitor - public void setBoostFactor(float boostFactor)
public void setLayouter(ILayouter layouter)
public ILayouter getLayouter()
Copyright (c) 2000, 2012 itemis AG and others. All rights reserved.