This is not really a question about SWT-Designer functionality, but as your lovely property sheet does a few things I can't figure out how to do, I would be extremely grateful if you could help with the following.
I am building a property sheet by cramming together a table viewer and a tree viewer. The constructor:
- Code: Select all
public PropertySheetViewer(Composite parent) {
// Note: SWT.FULL_SELECTION hides lines connecting nodes
super(parent, SWT.BORDER | SWT.FULL_SELECTION);
this.getTree().setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, true));
// create a column for property fields
propertyFieldColumn = new TreeViewerColumn(this, SWT.NONE);
propertyFieldColumn.getColumn().setMoveable(true);
propertyFieldColumn.setLabelProvider(new ColumnLabelProvider() {
public String getText(Object element) {
return ((PropertySheetNode) element).getPropertyField();
}
});
// create a column for property values
propertyValueColumn = new TreeViewerColumn(this, SWT.NONE);
propertyValueColumn.getColumn().setMoveable(true);
this.getTree().setLinesVisible(true);
this.getTree().setHeaderVisible(true);
this.getTree().getVerticalBar().setEnabled(true);
this.getTree().setSize(200, 300);
propertyValueColumn.getColumn().setWidth(100);
propertyFieldColumn.getColumn().setWidth(100);
}
You can see the results at http://dev.e-taxonomy.eu/trac/attachment/wiki/EclipseRCPResources/propertysheet.PNG.
There are 3 presentation-related issues I'm unable to solve:
1) How do I get rid of the excess "3rd column"?
2) I have used SWT.FULL_SELECTION to get rid of the lines connecting nodes in the tree - how do I get rid of the extra space where the lines used to be?
3) I would like to get rid of the table row borders for empty rows, i.e. I would like there to be nothing but blank space after the rows with data - any ideas?
Many, many thanks in advance,
Pepe Ciardelli