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 #565759] Fri, 29 September 2006 13:45
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;
}
Previous Topic:GEF viewer in CTableTreeCell
Next Topic:ColumnWidth for setFillLayout(true) column
Goto Forum:
  


Current Time: Sat Dec 20 22:20:01 GMT 2014

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

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