Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » ColumnWidth for setFillLayout(true) column
ColumnWidth for setFillLayout(true) column [message #12661] Fri, 29 September 2006 13:45 Go to next message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
>I'm admittedly a little confused here - would you be able to post the
>code for your cell?
>thanks!

I've just picked this back up again and I think I see where the problem is.

I have a tableTree of expandable composites. The tableTree has 1 column,
which is also the treeColumn. The column is set to fill the view
horizontally with column.setFillLayout(true). I have some prebuilt nodes
that I add to my tableTree on startup (i.e.
ContentProvider.setInput(prebuiltNodes)).

The CContainerLayout.computeHeaderSize(...) seems to the point where
columnWidths are initialized with iterated calls to column.getWidth().
During startup, the getWidth() call returns 0 (reminder that column
isAutoWidth. I've put in a default width in my parseStr so that I'm not
operating with 0 widths). On initial display therefore, line breaks are
all based on the default width regardless of what the column width
actually is. When I perform some action on the node (expand, add a child
node) that forces a call to update(..), columnWidths appear to have proper
values and the cell is redisplayed with appropriate line width breaks.

Trying to find out at what point the columnWidths are actually set to
proper widths.

I'm adding the update method here but it doesnt appear to be the issue.
parseStr(...) just uses a TextLayout to break str into lines according the
columnWidth measurement.

public boolean update(Object element, String[] properties)
{ if(update && element instanceof Node)
{ String str = ((Node) element).getCaption();
int[] lines = parseStr(str);

if(lines != null)
{ String formattedStr = format(str, lines, SWT.DEFAULT);

if(lines.length <= 2 || !((Node) element).hasChildren())
{ setText(formattedStr); }
else
setText(format(str, lines, 2));

if (text != null)
text.setText(formattedStr);

}
}

return false;
}
Re: ColumnWidth for setFillLayout(true) column [message #12683 is a reply to message #12661] Fri, 29 September 2006 13:59 Go to previous messageGo to next message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
I should probably also state that my ultimate goal is to get the breaks to
be set in tandem with a column size (with a minimum breakWidth).
May be parent sash form problem.. [message #12704 is a reply to message #12683] Fri, 29 September 2006 15:35 Go to previous message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
The tableTree is a child in a two-part sashform. The weights for the
sashForm are set after the sashForm children are created.

The columnWidths might not be set until the sashForm resize is called,
which is after the tableTree Nodes have actually been formatted with
default width...
Re: ColumnWidth for setFillLayout(true) column [message #565781 is a reply to message #12661] Fri, 29 September 2006 13:59 Go to previous message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
I should probably also state that my ultimate goal is to get the breaks to
be set in tandem with a column size (with a minimum breakWidth).
May be parent sash form problem.. [message #565800 is a reply to message #12683] Fri, 29 September 2006 15:35 Go to previous message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
The tableTree is a child in a two-part sashform. The weights for the
sashForm are set after the sashForm children are created.

The columnWidths might not be set until the sashForm resize is called,
which is after the tableTree Nodes have actually been formatted with
default width...
Previous Topic:ColumnWidth for setFillLayout(true) column
Next Topic:Drag & Drop ctableTreeItems?
Goto Forum:
  


Current Time: Tue Mar 19 05:14:29 GMT 2024

Powered by FUDForum. Page generated in 0.02762 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top