final ModalWindow metaDataModalWindow;
add(metaDataModalWindow = new ModalWindow("modalwindow"));
// Adding menu tree node
menuTreeRoot = new DefaultTreeModel(rootNode);
controlMenuTabs(false);
final AjaxTabbedPanel menusTab = new AjaxTabbedPanel("menuTabs", menuTabs);
menuTree = new LinkTree("menuTree", new PropertyModel(this, "menuTreeRoot"))
{
@Override
protected void onNodeLinkClicked(Object node, BaseTree tree,
AjaxRequestTarget target)
{
Object userObject = ((DefaultMutableTreeNode) node).getUserObject();
if (!(userObject instanceof MenuTreeNode))
{
return;
}
MenuTreeNode menuNode = (MenuTreeNode) userObject;
if (menuNode.getName() != null && !menuNode.getName().equalsIgnoreCase("_MenusRootNode_"))
{
setMenuDefinition(menuNode.getDefinition());
controlMenuTabs(true);
menusTab.setSelectedTab(0);
target.addComponent(menusTab);
}
}
};