public void loadView(Event<? extends UIComponent> event) throws Exception { UISpaceNavigationNodeSelector uiNodeSelector = getChild(UISpaceNavigationNodeSelector.class); UITree uiTree = uiNodeSelector.getChild(UITree.class); uiTree .createEvent("ChangeNode", event.getExecutionPhase(), event.getRequestContext()) .broadcast(); }
@Override public void execute(Event<UISpaceNavigationManagement> event) throws Exception { UISpaceNavigationManagement uiManagement = event.getSource(); UISpaceNavigationNodeSelector uiNodeSelector = uiManagement.getChild(UISpaceNavigationNodeSelector.class); UIRightClickPopupMenu menu = uiNodeSelector.getChild(UIRightClickPopupMenu.class); menu.createEvent("AddNode", Phase.PROCESS, event.getRequestContext()).broadcast(); }
protected String getBreadcrumb() throws Exception { UISpaceNavigationNodeSelector selector = getChild(UISpaceNavigationNodeSelector.class); UITree uiTree = selector.getChild(UITree.class); TreeNode selectedNode = uiTree.getSelected(); TreeNode rootNode = selector.getRootNode(); List<TreeNode> nodes = new ArrayList<TreeNode>(); while (selectedNode.getId() != rootNode.getId()) { nodes.add(selectedNode); selectedNode = selectedNode.getParent(); } StringBuffer sb = new StringBuffer(); sb.append("<li>"); sb.append("<a href='javascript:void(0);'>").append(SPACE_LABEL).append("</a>"); sb.append("</li>"); for (int idx = nodes.size() - 1; idx >= 0; idx--) { String nodeLabel = nodes.get(idx).getResolvedLabel(); nodeLabel = StringEscapeUtils.escapeHtml(nodeLabel); sb.append("<li>"); sb.append("<span class='uiIconMiniArrowRight'> </span>"); sb.append("</li>"); if (idx == 0) { sb.append("<li class=\"active\">"); } else { sb.append("<li>"); } sb.append("<a href=\"javascript:void(0);\" onclick=\"") .append(this.event("SelectNode", nodes.get(idx).getId())) .append("\""); sb.append(">").append(nodeLabel).append("</a>"); sb.append("</li>"); } return sb.toString(); }