GEF viewer in CTableTreeCell [message #11265] |
Thu, 14 September 2006 16:43 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
i'm attempting to get a GEF based viewer to show up in a cell.
here's (a slightly simplified version of) the code. SalesViewer is a
class that draws a diagram into its composite. it happens to use GEF to
do this, although that shouldn't matter to this code. it is setup so
that the diagram should appear in the title area of the table cell.
the viewers are being correctly initialized (checked that in debugger).
and clearly something is happening because the rows heights are changing
in the appropriate window. unfortunately, nothing is visible in the
cell, the blank background remains unchanged.
has anyone got something like this working (granted jeremy is probably
the only one who may have tried :-)? if not, does anyone have
suggestions on a troubleshooting procedure. what events should i try to
set off (paint? resize? selectio?), and where should i set the debugger,
etc. to get a handle on what might be going wrong.
regards,
al
public class ViewerCell extends CTableTreeCell {
SalesViewer fCSV;
public ViewerCell(CContainerItem item, int style) {
super(item, style | SWT.TITLE);
}
private SalesViewer getSV() {
if ( fCSV == null ) {
fCSV = new SalesViewer();
}
return fCSV;
}
protected void createTitleContents(Composite contents, int style) {
getSV().createControl(contents, SWT.NO_BACKGROUND);
}
public boolean update(Object element, String[] properties) {
if ( element instanceof AreaRefNode ) {
getSV().init(element);
}
return false;
}
}
|
|
|
|
Re: GEF viewer in CTableTreeCell [message #11339 is a reply to message #11302] |
Fri, 15 September 2006 20:06 |
Eclipse User |
|
|
|
Originally posted by: alnospammajor.noboxspamspoon.com
Cal wrote:
> Hi
>
> I vaguely remember one point where my control was not showing up in the
> "contents" composite and the solution was to set the layout of contents
> to a FillLayout..)or if you dont want to distort an image add a child
> composite to contents. )
>
that worked for me. thanks!
> Also maybe you can offer a suggestion for me. I have a tree of
> expandable composites, just a text cell in the child area. Everything
> displays properly on expansion. However if I close a parentItem and the
> parent has a childItem that is "open" the control is not erased. A
> redraw is called for the container so I'm not sure where the problem
> lies. It paints properly if childItems are not "open".
>
i haven't yet got to expanding and closing tree nodes (one step at a
time :-). i'll let you know if i find anything when i get there.
thx,
al
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04607 seconds