Search in sources :

Example 1 with Container

use of org.olat.core.gui.components.Container in project OpenOLAT by OpenOLAT.

the class DevelopmentController method dumpTree.

private void dumpTree(StringOutput sb, Component current, int indent, Map<Controller, List<Component>> controllerInfos) {
    // add infos,
    Controller lController = org.olat.core.gui.dev.Util.getListeningControllerFor(current);
    if (lController != null) {
        List<Component> lcomps = controllerInfos.get(lController);
        if (lcomps == null) {
            // first entry
            lcomps = new ArrayList<Component>();
            controllerInfos.put(lController, lcomps);
        }
        lcomps.add(current);
    }
    int pxInd = indent * 25;
    String pcid = Renderer.getComponentPrefix(current);
    sb.append("<div id='dmt_").append(pcid).append("' ");
    if (current.isVisible() && current.isDomReplaceable()) {
        sb.append(" onMouseOver=\"jQuery(this).css('background-color','#f3feff');o_dbg_mark('").append(pcid).append("')\" onMouseOut=\"jQuery(this).css('background-color','');o_dbg_unmark('").append(pcid).append("')\"");
    }
    sb.append(" style=\"color:blue; padding-bottom:2px; font-size:10px\"><div style=\"margin-left:" + pxInd + "px\">");
    String cname = current.getClass().getName();
    cname = cname.substring(cname.lastIndexOf('.') + 1);
    sb.append("<b>" + cname + "</b> (" + current.getComponentName() + " id " + current.getDispatchID() + ") ");
    if (current == mainComp) {
        // suppress detail and subtree for our controller here
        sb.append(" --suppressing output, since developmentcontroller --</div></div>");
    } else {
        sb.append((current.isVisible() ? "" : "INVISIBLE ") + (current.isEnabled() ? "" : " NOT ENABLED ") + current.getExtendedDebugInfo() + ", " + current.getListenerInfo() + "<br />");
        sb.append("</div></div>");
        if (current instanceof Container) {
            Container co = (Container) current;
            for (Component child : co.getComponents()) {
                dumpTree(sb, child, indent + 1, controllerInfos);
            }
        }
    }
}
Also used : VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer) Container(org.olat.core.gui.components.Container) FloatingResizableDialogController(org.olat.core.gui.control.floatingresizabledialog.FloatingResizableDialogController) ExpColController(org.olat.core.gui.control.generic.spacesaver.ExpColController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) DefaultController(org.olat.core.gui.control.DefaultController) Component(org.olat.core.gui.components.Component)

Example 2 with Container

use of org.olat.core.gui.components.Container in project openolat by klemens.

the class DevelopmentController method dumpTree.

private void dumpTree(StringOutput sb, Component current, int indent, Map<Controller, List<Component>> controllerInfos) {
    // add infos,
    Controller lController = org.olat.core.gui.dev.Util.getListeningControllerFor(current);
    if (lController != null) {
        List<Component> lcomps = controllerInfos.get(lController);
        if (lcomps == null) {
            // first entry
            lcomps = new ArrayList<Component>();
            controllerInfos.put(lController, lcomps);
        }
        lcomps.add(current);
    }
    int pxInd = indent * 25;
    String pcid = Renderer.getComponentPrefix(current);
    sb.append("<div id='dmt_").append(pcid).append("' ");
    if (current.isVisible() && current.isDomReplaceable()) {
        sb.append(" onMouseOver=\"jQuery(this).css('background-color','#f3feff');o_dbg_mark('").append(pcid).append("')\" onMouseOut=\"jQuery(this).css('background-color','');o_dbg_unmark('").append(pcid).append("')\"");
    }
    sb.append(" style=\"color:blue; padding-bottom:2px; font-size:10px\"><div style=\"margin-left:" + pxInd + "px\">");
    String cname = current.getClass().getName();
    cname = cname.substring(cname.lastIndexOf('.') + 1);
    sb.append("<b>" + cname + "</b> (" + current.getComponentName() + " id " + current.getDispatchID() + ") ");
    if (current == mainComp) {
        // suppress detail and subtree for our controller here
        sb.append(" --suppressing output, since developmentcontroller --</div></div>");
    } else {
        sb.append((current.isVisible() ? "" : "INVISIBLE ") + (current.isEnabled() ? "" : " NOT ENABLED ") + current.getExtendedDebugInfo() + ", " + current.getListenerInfo() + "<br />");
        sb.append("</div></div>");
        if (current instanceof Container) {
            Container co = (Container) current;
            for (Component child : co.getComponents()) {
                dumpTree(sb, child, indent + 1, controllerInfos);
            }
        }
    }
}
Also used : VelocityContainer(org.olat.core.gui.components.velocity.VelocityContainer) Container(org.olat.core.gui.components.Container) FloatingResizableDialogController(org.olat.core.gui.control.floatingresizabledialog.FloatingResizableDialogController) ExpColController(org.olat.core.gui.control.generic.spacesaver.ExpColController) Controller(org.olat.core.gui.control.Controller) BasicController(org.olat.core.gui.control.controller.BasicController) DefaultController(org.olat.core.gui.control.DefaultController) Component(org.olat.core.gui.components.Component)

Aggregations

Component (org.olat.core.gui.components.Component)2 Container (org.olat.core.gui.components.Container)2 VelocityContainer (org.olat.core.gui.components.velocity.VelocityContainer)2 Controller (org.olat.core.gui.control.Controller)2 DefaultController (org.olat.core.gui.control.DefaultController)2 BasicController (org.olat.core.gui.control.controller.BasicController)2 FloatingResizableDialogController (org.olat.core.gui.control.floatingresizabledialog.FloatingResizableDialogController)2 ExpColController (org.olat.core.gui.control.generic.spacesaver.ExpColController)2