Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » tableTreeViewer.reveal & Decorators
tableTreeViewer.reveal & Decorators [message #16210] Wed, 01 November 2006 22:55 Go to next message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
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 #16269 is a reply to message #16210] Sun, 05 November 2006 14:29 Go to previous messageGo to next message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
Messages: 181
Registered: July 2009
Senior Member
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 #16295 is a reply to message #16269] Sun, 05 November 2006 16:39 Go to previous messageGo to next message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
>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.
Decorators working with CTableTree! [message #16363 is a reply to message #16295] Wed, 08 November 2006 00:03 Go to previous messageGo to next message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
Hi

I was using the Eclipse article for a guide and couldnt get this to work.
I found a thread that gave a 3step instruction for lightweight decorators
and its working!
Solution Thread location... [message #16377 is a reply to message #16295] Wed, 08 November 2006 00:08 Go to previous message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
The thread is titled "Decorators and enablement" (Tom Creasy)
Re: tableTreeViewer.reveal & Decorators [message #568099 is a reply to message #16210] Sun, 05 November 2006 14:29 Go to previous message
Jeremy Dowdall is currently offline Jeremy DowdallFriend
Messages: 181
Registered: July 2009
Senior Member
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 16:39 Go to previous message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
>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.
Decorators working with CTableTree! [message #568356 is a reply to message #16295] Wed, 08 November 2006 00:03 Go to previous message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
Hi

I was using the Eclipse article for a guide and couldnt get this to work.
I found a thread that gave a 3step instruction for lightweight decorators
and its working!
Solution Thread location... [message #568395 is a reply to message #16295] Wed, 08 November 2006 00:08 Go to previous message
Cal is currently offline CalFriend
Messages: 70
Registered: July 2009
Member
The thread is titled "Decorators and enablement" (Tom Creasy)
Previous Topic:How to use individual widgets
Next Topic:Picture gallery widget
Goto Forum:
  


Current Time: Thu Apr 25 19:08:37 GMT 2024

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

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

Back to the top