This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes tomahawk t:tree2 doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "tomahawk t:tree2 doubt" Watch "tomahawk t:tree2 doubt" New topic
Author

tomahawk t:tree2 doubt

Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
Is there any way to increase the length of the branch using <t:tree2> ?

I want this so that the tree will look spacious.

A
|________________B

Suppose A is the root node with B as its child, do I have control over the
bold line distance ?


SCJP,SCWCD, Into ATG now!
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Hi again Joshua,

Not that I know of. But if it turns out that it's not possible, you could always set the showLines attribute to false and use an image instead, just before your node.description... Make the image a longer line...

Mm, that would work, but I spose then you'd have the problem of your first node also having a long line.. like this
|---------A
|---------B

Which is not so nice. You got me. I'll hunt around though and see if I can find something.

cheers
Darryl
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
Ok this is what I've found so far. Will keep digging though.

All that those lines are any way is gif's. They come with tomahawk and sit on your webserver.

/YourWebContext/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12162986/tree2.HtmlTreeRenderer/images/line-middle.gif

So we must try find a way to use more other images. I see there is an attribute on the tree2 component called imageLocation. Maybe you could make your own images, and point imageLocation to them. Call them the same name for example line-middle.gif...

That sounds like it'll work hey? Let me know if it does.

cheers
Darryl
Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
Hi Darryl,

I tried replacing the image, but it is not getting rendered properly. May be the width is predefined in the api.

However increase of width is possible in t:tree, the problem occurs in t:tree2.

Regards,
Joshua
Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
I looked into the org.apache.myfaces.custom.tree2.HtmlTreeRenderer class.

Yes line-middle.gif and line-last.gif is hardcoded with values where as line-trunk.gif is set as background hence only its size can be increased.

This might help someone.

Regards,
Joshua
 
 
subject: tomahawk t:tree2 doubt
 
Similar Threads
Related to tree2 of tomahak
How to work with t:tree component
f:facet funtionality
selectBooleanCheckbox inside a tree2
TreeTable and row selection