Hi Cristi,

thanks for the answer so far!

> there are 2 types of icons, like in the windows explorer tree: ...
Yes, yes, I understood that (probably I didn't seem to... ). Anyways,
you made that pretty clear now for "first-readers" ;-)

> and change the getNodeType() method like this:
>
> public String getNodeType()
> {
>    if (nodes == null || nodes.isEmpty) return "node";
>   return "leaf";
> }
>
> This way you won't need to define each nodes type at creation.
Yes, indeed, that's far nicer than my approach!

But... when I follow the rest of your advice then, yes, those folder/leaf
icons are
aligned but they don't get the functionality to collapse/expand the folders
which
"stays" in the first column where I then get the (default?) plus/minus icons 
(~/adf/images/nav-plus.gif ...). Of course I could get rid of those
plus/minus icons
by defining some very small, invisible icon here, but that would still not
solve
the problem to "move" the collapse/expand functionality to my nicely aligned
folder/leaf icons...

I hope I could make myself clear - and more so that there still is a
solution to
my problem ;-)

Thanks, Carsten


Cristi Toth wrote:
> 
> ok, it seems that I need to do some help page on this, cause it's not
> clear
> enough
> 
> there are 2 types of icons, like in the windows explorer tree:
> 
> 1. the expanded/collapsed icons (+/- from windows, and the current
> default)
> "af|tree::expanded-icon", "af|tree::collapsed-icon"
> these icons are rendered ONLY for nodes which have children
> they are rendered on the first "active" column of that node  (over the
> vertical line that node is connected to)
> 
> 2. the node icons - (folder and file icons from windows)
> these are rendered for ANY node (including leafs and nodes)
> and they are rendered in the column NEXT to the icon mentioned at point 1.
> these icon selectors are composed using the nodeType value
> "af|tree::node-icon:nodeType-expanded"
> "af|tree::node-icon:nodeType-collapsed"
> "af|tree::node-icon:nodeType"
> the first two are used for nodes who have children
> the last one is used for "leafs"
> 
> SO, Carsten
> I would suggest for your case not to use any of the selectors at point 1.
> Instead use the selectors at point 2.
> and change the getNodeType() method like this:
> 
> public String getNodeType()
>  {
>    if (nodes == null || nodes.isEmpty) return "node";
>    return "leaf";
>  }
> 
> This way you won't need to define each nodes type at creation.
> 
> then use the following selectors:
> "af|tree::node-icon:node-expanded"
> "af|tree::node-icon:node-collapsed"
> "af|tree::node-icon:leaf"
> 
> This way you won't need any other CSS styling for the alignement.
> 
> I hope this addresses your problem and solves it :)
> 
> Regards,
> 
> On Jan 29, 2008 2:44 PM, Carsten Pieper <[EMAIL PROTECTED]>
> wrote:
> 
>>
>> Hi,
>>
>> I have been fiddling around with the improved tree skinning recently.
>> Looks fine (thanks to Cristi!), but I have a question concerning the
>> alignment of those "node-icons" (e.g. look here, if in doubt what these
>> might be:
>>
>> http://www.nabble.com/Tree-skinning-problem-with-Trinidad-1.2.5-to15049337.html#a15154727
>> Tree-skinning-problem-with-Trinidad-1.2.5 )
>>  with the "collapsed-" and "expanded-icons" (skinned by
>> selectors af|tree::collapsed-icon, af|tree::expanded-icon etc. ...).
>>
>> I have a tree with nodes/folders and leaves, well, a tree...
>>
>> What I get is something like this (sorry for the naming -this
>> is taken from a "grown" example...):
>> http://www.nabble.com/file/p15159675/whatIHave.jpg
>>
>> As you can see, leaves aren't aligned with folders on the same level.
>> I would like to have them all aligned as shown here:
>> http://www.nabble.com/file/p15159675/whatIWant.jpg
>>
>> Is there a way to achieve such an alignment via CSS definitions in
>> my skin? (Note that the "space" for the expanded-/collapsed-icons
>> is kept free (but occupying space) in a "leaf row", right now.)
>>
>> Thanks in advance,
>> Carsten
>>
>> PS I attach snippets of my sources (just if anyone wanted to have a
>> look).
>> ...
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-Trinidad--Fine-tuning-the-node-icon-%28--%3E-improved-tree-skinning%29-tp15159675p15176672.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to