This is a gridLayout in which the Available side is a Tree Viewer and The Selected side is a ListViewer. Now I have to get a toolTip on the right hand side. Which I am unable to get. I am working on a existing code base , so I am unable to figure out on which line did they add a tooltip + I did not find any keywords like tooltip or mouse Hover. Still how is this implemented. I am mentioning some code. I believe the answer should be somewhere here only.
availableViewer = new TreeViewer(resultsComposite, SWT.BORDER | this.getStyle());
availableViewer.setContentProvider(new ResAndResGroupTreeContentProvider());
availableViewer.setLabelProvider(SelectionItemLabelProvider.getInstance());
Tree availableResults = availableViewer.getTree();
GridData availableResultsGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
availableResultsGridData.widthHint = LIST_WIDTH_HINT;
availableResultsGridData.heightHint = LIST_HEIGHT_HINT;
availableResults.setLayoutData(availableResultsGridData);
availableViewer.getTree().addSelectionListener(new SelectionAdapter()
{
@Override
public void widgetDefaultSelected(SelectionEvent e)
{
moveAvailableItemsToSelected();
}
});
This is the selectionViewer content.
selectedViewer = new ListViewer(resultsComposite, SWT.V_SCROLL | SWT.H_SCROLL| SWT.BORDER
| this.getStyle());
selectedViewer.setContentProvider(new ResAndResGroupTreeContentProvider());
selectedViewer.setLabelProvider(new SelectionItemLabelProvider());
org.eclipse.swt.widgets.List selectedResults = selectedViewer.getList();
GridData selectedResultsGridData = new GridData(SWT.FILL, SWT.FILL, true, true);
selectedResultsGridData.widthHint = LIST_WIDTH_HINT;
selectedResultsGridData.heightHint = LIST_HEIGHT_HINT;
selectedResults.setLayoutData(selectedResultsGridData);
selectedViewer.addDoubleClickListener(new IDoubleClickListener()
{
@Override
public void doubleClick(DoubleClickEvent event)
{
moveSelectedItemsToAvailable();
}
});
selectedViewer.getList().addKeyListener(new KeyAdapter()
{
@Override
public void keyPressed(KeyEvent e)
{
if (e.character == SWT.CR)
{
moveSelectedItemsToAvailable();
}
}
});
selectedViewer.addSelectionChangedListener(new ISelectionChangedListener()
{
@Override
public void selectionChanged(SelectionChangedEvent event)
{
updateButtonsEnabled();
}
});
Thanks.
ColumnViewerToolTipSupport
is the usual way but I don't see that here. – Trichology