You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by wfaler <wi...@gmail.com> on 2007/10/03 09:37:48 UTC
custom icons on LinkTree nodes?
Hi,
I'm using a LinkTree to display a tree-structure with links in a sidebar.
What do I have to do to get it to display custom icons (on a per node-basis)
in the tree?
Help would be very much appreciated.
/ Wille
--
View this message in context: http://www.nabble.com/custom-icons-on-LinkTree-nodes--tf4560283.html#a13014231
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: custom icons on LinkTree nodes?
Posted by swaroop belur <sw...@gmail.com>.
If you are referring to open/close images....
Try this in ur LinkTree class impl:
protected Component newNodeComponent(String id, IModel model)
{
return new LinkIconPanel(id, model, LinkTree.this)
{
private static final long serialVersionUID = 1L;
protected void onNodeLinkClicked(TreeNode node, BaseTree tree,
AjaxRequestTarget target)
{
super.onNodeLinkClicked(node, tree, target);
LinkTree.this.onNodeLinkClicked(node, tree, target);
}
@Override
protected ResourceReference getResourceFolderOpen(TreeNode node) {
// return ur own resource ref impl for ur custom open image
// On per node basis, just use the above
node ref to do ur stuff
}
protected ResourceReference
getResourceFolderClosed(TreeNode node)
{
// return ur own resource ref impl for ur custom close image
}
protected ResourceReference
getResourceItemLeaf(TreeNode node)
{
// return ur own resource ref impl for ur custom leaf image
}
};
}
-swaroop
wfaler wrote:
>
> Hi,
> I'm using a LinkTree to display a tree-structure with links in a sidebar.
> What do I have to do to get it to display custom icons (on a per
> node-basis) in the tree?
>
> Help would be very much appreciated.
>
> / Wille
>
--
View this message in context: http://www.nabble.com/custom-icons-on-LinkTree-nodes--tf4560283.html#a13014455
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org