use of com.revolsys.ui.html.layout.DefinitionListLayout in project com.revolsys.open by revolsys.
the class DisplayConfigAction method addSiteNode.
private void addSiteNode(final ElementContainer view, final SiteNode siteNode) {
if (siteNode != null) {
final ElementContainer nodeView = new ElementContainer();
view.add(nodeView);
final String path = siteNode.getPath();
if (path == null) {
nodeView.add(new XmlTagElement(HtmlElem.H4, "/"));
} else {
nodeView.add(new XmlTagElement(HtmlElem.H4, path));
}
final SiteNodeController controller = siteNode.getController();
if (controller instanceof PageController) {
final PageController pageController = (PageController) controller;
final ElementContainer pageView = new ElementContainer(new DefinitionListLayout());
nodeView.add(pageView);
pageView.add("Actions");
final ElementContainer actionsView = new ElementContainer(new UnorderedListLayout());
pageView.add(actionsView);
for (final Iterator actions = pageController.getActions().iterator(); actions.hasNext(); ) {
final Action action = (Action) actions.next();
actionsView.add(action.getClass().getName());
}
pageView.add("Menus");
final ElementContainer menusView = new ElementContainer(new UnorderedListLayout());
pageView.add(menusView);
for (final Iterator menus = pageController.getMenus().entrySet().iterator(); menus.hasNext(); ) {
final Map.Entry entry = (Entry) menus.next();
final String name = (String) entry.getKey();
final Menu menu = (Menu) entry.getValue();
addMenu(menusView, name, menu);
}
}
final Collection nodes = siteNode.getNodes();
if (!nodes.isEmpty()) {
final ElementContainer childNodesView = new ElementContainer(new UnorderedListLayout());
nodeView.add(childNodesView);
for (final Iterator nodeIter = nodes.iterator(); nodeIter.hasNext(); ) {
final SiteNode childNode = (SiteNode) nodeIter.next();
addSiteNode(childNodesView, childNode);
}
}
}
}
Aggregations