Property Sheet

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Property Sheet

Postby pepe_ciardelli » Wed Feb 06, 2008 6:11 am

Hi there,

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
pepe_ciardelli
 
Posts: 1
Joined: Wed Feb 06, 2008 6:04 am

Re: Property Sheet

Postby Eric Clayberg » Wed Feb 06, 2008 11:13 am

The property sheet used in SWT Designer is a custom, owner drawn widget.

We don't use the Eclipse table viewer or tree viewer because they aren't very flexible.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests