Class TreeController


  • public class TreeController
    extends org.apache.struts.tiles.actions.TilesAction
    Perform initialisation steps for displaying a tree
    Author:
    Mark Woodbridge, Kim Rutherford
    • Field Summary

      • Fields inherited from class org.apache.struts.action.Action

        servlet
    • Constructor Summary

      Constructors 
      Constructor Description
      TreeController()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.struts.action.ActionForward execute​(org.apache.struts.tiles.ComponentContext context, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      protected java.util.List<TreeNode> makeNodes​(ClassDescriptor parent, java.util.Set<java.lang.String> openClasses, int depth, java.util.Map<?,​?> classCounts, java.util.List<java.lang.String> structure, boolean last)
      Produce a list of tree nodes for a class and its children, marking as 'open' and recursing on any that appear on the openClasses list.
      • Methods inherited from class org.apache.struts.tiles.actions.TilesAction

        execute
      • Methods inherited from class org.apache.struts.action.Action

        addErrors, addMessages, execute, generateToken, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TreeController

        public TreeController()
    • Method Detail

      • execute

        public org.apache.struts.action.ActionForward execute​(org.apache.struts.tiles.ComponentContext context,
                                                              org.apache.struts.action.ActionMapping mapping,
                                                              org.apache.struts.action.ActionForm form,
                                                              javax.servlet.http.HttpServletRequest request,
                                                              javax.servlet.http.HttpServletResponse response)
                                                       throws java.lang.Exception
        Overrides:
        execute in class org.apache.struts.tiles.actions.TilesAction
        Throws:
        java.lang.Exception
      • makeNodes

        protected java.util.List<TreeNode> makeNodes​(ClassDescriptor parent,
                                                     java.util.Set<java.lang.String> openClasses,
                                                     int depth,
                                                     java.util.Map<?,​?> classCounts,
                                                     java.util.List<java.lang.String> structure,
                                                     boolean last)
        Produce a list of tree nodes for a class and its children, marking as 'open' and recursing on any that appear on the openClasses list.
        Parameters:
        parent - the root class
        openClasses - the Set of open classes
        depth - the current depth from the root
        classCounts - the classCounts attribute from the ServletContext
        structure - a list of Strings - for definition see TreeNode.getStructure
        last - true if this is the last sibling
        Returns:
        a List of nodes