I am writing an Eclipse plugin which has a hover control that consists of two controls, one on top of another:
An HTML viewer (BrowserInformationControl) for which I Can easily compute the size hint
A TreeViewer that contains a Tree.
I have set up my tree with actual contents. However, I can’t find a way to figure out the size of the tree or the size hint for it once rendered.
According to the API of org.eclipse.swt.widgets.Tree, this should be done with:
Note that on Windows, the behavior of
computeSize()was flawed: see this message and this bug: fixed for eclipse 3.4M1 and forward.Example of use of
computeSize()in this message.The use of
getBound()might be another interesting alternative.