How to align text in a TreeViewer cell [message #1754710] |
Tue, 21 February 2017 17:28 |
Frank Gruendel Messages: 22 Registered: January 2014 |
Junior Member |
|
|
Hi experts,
by now I have spent the better part of two hours in the world wide WEB in vain. All I want to do is to change the vertical alignment of the text in a Treeviewer. As you can see in the image, the text is top-aligned whereas it should be center-aligned.
I am using Eclipse Mars.1 Release (4.5.1) with RAP 3.0.2 as the target platform.
As can be seen in the image, I have tinkered with the CSS properties of TreeItem, but this doesn't seem the proper strategy since the alignment seems to not be part of what can be controlled via CSS.
My TreeViewer is created like this:
private Control getTabControl_Tab1(final CTabFolder tabFolder)
{
final Composite composite = new Composite(tabFolder, SWT.NONE);
composite.setLayout(new FillLayout());
m_treeViewer_Plain = new TreeViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
m_treeViewer_Plain.getTree().setBackground(PMCColors.DEFAULT_BACKGROUND);
m_treeViewer_Plain.setContentProvider(new MyViewContentProvider(false));
m_treeViewer_Plain.setLabelProvider(new MyViewLabelProvider());
m_treeViewer_Plain.setUseHashlookup(true);
m_treeViewer_Plain.setSorter(new ViewerSorter());
m_treeViewer_Plain.setInput(getController());
composite.pack();
return composite;
}
The LabelProvider, in case this is of any importance, extends LabelProvider.
I appear to be unable to find the place where this text is actually painted. If anybody could shed some light on this problem, I will be thankful forever
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03031 seconds