Hi again,
I've nearly solved the problem myself:
Code:
private void initDynamicMenuBar(List<FunctionTree> functionTrees) {
dynamicMenuBar = new ROWDYNAMICCONTENTBinding();
dynamicMenuBar.setContentNodes(new ArrayList<ComponentNode>());
MENUBARNode menuBarNode = new MENUBARNode();
dynamicMenuBar.getContentNodes().add(menuBarNode);
for (FunctionTree functionTree : functionTrees) {
FIXGRIDTreeBinding<FunctionNode> binding = functionTree.getFtree();
FunctionNode item = (FunctionNode) binding.getRootNode();
addMenuNode(menuBarNode, item);
}
}
private void addMenuNode(ComponentNode parentNode, FunctionNode item) {
if (hasChildNodes(item)) {
MENUNode node = new MENUNode();
parentNode.addSubNode(node);
node.setText(item.getText());
for (FIXGRIDTreeItem childItem : item.getChildNodes()) {
addMenuNode(node, (FunctionNode) childItem);
}
} else {
MENUITEMNode node = new MENUITEMNode();
parentNode.addSubNode(node);
node.setText(item.getText());
node.setImage(item.getImage());
node.setReference(item.getJspPage());
node.setActionListener("#{d.WorkplaceMBean.onShowPage}");
}
}
private boolean hasChildNodes(FunctionNode item) {
return (item.getChildNodes() != null) && (item.getChildNodes().size() > 0);
}
But there is still one problem: the rootentries in the menubar have the text 'default' instead of the text defined in the configurationfile.
Regards
Horst