tableTreeViewer.reveal & Decorators [message #16210] |
Wed, 01 November 2006 17:55  |
Eclipse User |
|
|
|
Hi
None of these items are critical (well maybe the decorators):
I have a use case to search the CTableTree. When any item in the "found"
list is selected, the tree sends focus to that item. I was initially using
the CTableTree.reveal(), it will do what I want if the item is painted. I
added the code from the CTableTree.handleMouseEvents(..) that handles tree
expansion to recursively open the parent nodes (up to first opened parent
or null) then select the node. I wanted to know if this is what reveal
should do or if the extra code is necessary. I checked the javadocs for
TreeViewer but its not clear if a non-painted node gets expanded with
reveal()...
2nd. Decorators..I'm using an DecoratingLabelProvider for my ctabletree
labelProvider, it interfaces with an ILabelProvider. I've stepped through
the code for decorating the image and the overlay image is drawn with no
errors reported but the image doesnt get decorated...this should work
correct?
And 3rd I guess...the selected-but-no-focus ForeGround color (if I click
over to the editor for example) for the item text is white, it should be
some contrasting color to the background.
Thanks
|
|
|
|
Re: tableTreeViewer.reveal & Decorators [message #16295 is a reply to message #16269] |
Sun, 05 November 2006 11:39   |
Eclipse User |
|
|
|
>For the first issue with CTableTree.reveal(), please follow bug #162138 (add
>comments too if you have time). Issues such as this should be better handled
in >the future when CTableTree's identity crisis is over :)
ok.
>The decorators I haven't used before - please add a bug for them with your
>example code.
ok again:) I should add that it might not be ctabletree at all, just my
code!
>The third issue with the "selected but no-focus" foreground color sounds like
>another win32 emulation problem - what color is the text in a native table
for >this situation?
when you select an item in a tree the colours are as you have them, if you
give focus to something else, like clicking in the editor, the background
changes to the background colour as you have it but the font goes to
black. Ctabletree leaves the foreground as white so its hard to read the
text against the new background.
>Also, are the lines between tree nodes drawing correctly now?
Yes! Though the section of the line parallel to the childArea is not being
drawn, but I'm not complaining, It's great! Also you were right about the
computeSize function and the scrolling, it was partly me not calculating
correctly for my use case, my titleHeight varies depending on whether or
not the ctableTreeItem has any children + I added extra 5 spaces between
each item. So 3 calculations are possible. The height may be short enough
to fit on 1 line, if it has children, two lines are used. For leaf items
all text is displayed up in the titleArea so height is dependent on amount
of text. I got that sorted out *but* I was still having problems with the
bodySize. I narrowed it down to a problem with leaf nodes. A call to
getText() would return an empty string so tSize.y would always be zero, I
countered by just keeping a variable with the fulltext and it
works...again...it could be my code, I'm calling setText() in the
update(), getBounds() and setOpen() in my cell not sure if all that is
necessary was just trying to get the text to update.
Another issue that I discovered really because of the varying titleHeight
for my use case. If useFixedTitleHeight=false titleHeight is never set,
its at 0. I noticed because it caused an issue with my toggle selection,
(toggleHeight=titleHeight btw I'm using the SWT.DROP_DOWN). I dont know if
this issue would pose a problem for anyone else it doesnt seem to affect
anything if the title is only one line.
|
|
|
|
|
Re: tableTreeViewer.reveal & Decorators [message #568099 is a reply to message #16210] |
Sun, 05 November 2006 09:29  |
Eclipse User |
|
|
|
Hi Cal,
For the first issue with CTableTree.reveal(), please follow bug #162138
(add comments too if you have time). Issues such as this should be
better handled in the future when CTableTree's identity crisis is over :)
The decorators I haven't used before - please add a bug for them with
your example code.
The third issue with the "selected but no-focus" foreground color sounds
like another win32 emulation problem - what color is the text in a
native table for this situation?
Also, are the lines between tree nodes drawing correctly now?
thanks!
Cal wrote:
> Hi
>
> None of these items are critical (well maybe the decorators):
>
> I have a use case to search the CTableTree. When any item in the "found"
> list is selected, the tree sends focus to that item. I was initially
> using the CTableTree.reveal(), it will do what I want if the item is
> painted. I added the code from the CTableTree.handleMouseEvents(..) that
> handles tree expansion to recursively open the parent nodes (up to first
> opened parent or null) then select the node. I wanted to know if this is
> what reveal should do or if the extra code is necessary. I checked the
> javadocs for TreeViewer but its not clear if a non-painted node gets
> expanded with reveal()...
>
> 2nd. Decorators..I'm using an DecoratingLabelProvider for my ctabletree
> labelProvider, it interfaces with an ILabelProvider. I've stepped
> through the code for decorating the image and the overlay image is drawn
> with no errors reported but the image doesnt get decorated...this should
> work correct?
>
> And 3rd I guess...the selected-but-no-focus ForeGround color (if I click
> over to the editor for example) for the item text is white, it should be
> some contrasting color to the background.
> Thanks
>
|
|
|
Re: tableTreeViewer.reveal & Decorators [message #568159 is a reply to message #16269] |
Sun, 05 November 2006 11:39  |
Eclipse User |
|
|
|
>For the first issue with CTableTree.reveal(), please follow bug #162138 (add
>comments too if you have time). Issues such as this should be better handled
in >the future when CTableTree's identity crisis is over :)
ok.
>The decorators I haven't used before - please add a bug for them with your
>example code.
ok again:) I should add that it might not be ctabletree at all, just my
code!
>The third issue with the "selected but no-focus" foreground color sounds like
>another win32 emulation problem - what color is the text in a native table
for >this situation?
when you select an item in a tree the colours are as you have them, if you
give focus to something else, like clicking in the editor, the background
changes to the background colour as you have it but the font goes to
black. Ctabletree leaves the foreground as white so its hard to read the
text against the new background.
>Also, are the lines between tree nodes drawing correctly now?
Yes! Though the section of the line parallel to the childArea is not being
drawn, but I'm not complaining, It's great! Also you were right about the
computeSize function and the scrolling, it was partly me not calculating
correctly for my use case, my titleHeight varies depending on whether or
not the ctableTreeItem has any children + I added extra 5 spaces between
each item. So 3 calculations are possible. The height may be short enough
to fit on 1 line, if it has children, two lines are used. For leaf items
all text is displayed up in the titleArea so height is dependent on amount
of text. I got that sorted out *but* I was still having problems with the
bodySize. I narrowed it down to a problem with leaf nodes. A call to
getText() would return an empty string so tSize.y would always be zero, I
countered by just keeping a variable with the fulltext and it
works...again...it could be my code, I'm calling setText() in the
update(), getBounds() and setOpen() in my cell not sure if all that is
necessary was just trying to get the text to update.
Another issue that I discovered really because of the varying titleHeight
for my use case. If useFixedTitleHeight=false titleHeight is never set,
its at 0. I noticed because it caused an issue with my toggle selection,
(toggleHeight=titleHeight btw I'm using the SWT.DROP_DOWN). I dont know if
this issue would pose a problem for anyone else it doesnt seem to affect
anything if the title is only one line.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04180 seconds