final North north = bl.getNorth();
north.setHeight(north.getHeight() + "px");
final Div div = (Div) north.getFellow("divDropDownMenu");
final Menubar menuBar = (Menubar) div.getFellow("mainMenuBar");
menuBar.setVisible(true);
// generate the menu from the menuXMLFile
getDropDownMenuFactory().addMenu(menuBar);
final Menuitem changeToTreeMenu = new Menuitem();
changeToTreeMenu.setLabel(Labels.getLabel("menu_Item_backToTree"));
changeToTreeMenu.setImage("/images/icons/refresh2_yellow_16x16.gif");
changeToTreeMenu.setParent(menuBar);
changeToTreeMenu.addEventListener("onClick", new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
// get an instance of the borderlayout defined in the
// index.zul-file
final Borderlayout bl = (Borderlayout) Path.getComponent("/outerIndexWindow/borderlayoutMain");
// get an instance of the searched west layout area
final West west = bl.getWest();
west.setVisible(true);
final North north = bl.getNorth();
final Div div = (Div) north.getFellow("divDropDownMenu");
final Menubar menuBar = (Menubar) div.getFellow("mainMenuBar");
menuBar.getChildren().clear();
menuBar.setVisible(false);
// set the MenuOffset for correct calculating content height.
final Checkbox cb = (Checkbox) Path.getComponent("/outerIndexWindow/CBtreeMenu");
cb.setChecked(true);
UserWorkspace.getInstance().setTreeMenu(true);