Class WebDropMenuDepictor<C extends Menu>

  • Type Parameters:
    C - The type of component being depicted.
    All Implemented Interfaces:
    ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>

    public class WebDropMenuDepictor<C extends Menu>
    extends AbstractWebMenuDepictor<C>
    Strategy for rendering a menu as a drop menu. The following illustrates a simplified drop menu structure.
     
    <div class="dropMenu" style="position:relative;">
            <label>Menu</label>
            <div class="dropMenu-container" style="position:absolute;left:0%;top:100%;width:1000%">
                    <div class="dropMenu-body" style="position:absolute;left:0%;top:0%;">
                            <table class="layout-flow-y">
                                    <tbody>
                                            <tr class="layout-flow-y">
                                                    <td class="layout-flow-y-child"><div>
                                                            <a href=""><span>Submenu</span></a></div>
                                                    </td>
                                            </tr>
                                    </tbody>
                            </table>
                    </div>
            </div>
    </div>
    
     
    Author:
    Garret Wilson
    • Constructor Detail

      • WebDropMenuDepictor

        public WebDropMenuDepictor()
        Default constructor using the XHTML <ol> element.
    • Method Detail

      • getOuterStyles

        protected java.util.Map<java.lang.String,​java.lang.Object> getOuterStyles()
        Retrieves the styles for the outer element of the component. This version adds relative positioning to make the main part of the menu the containing block for absolute child positioning. //TODO del This version removes the visibility specification, allowing this to be controlled by client JavaScript.
        Overrides:
        getOuterStyles in class AbstractWebComponentDepictor<C extends Menu>
        Returns:
        The styles for the outer element of the component, mapped to CSS property names.
        See Also:
        AbstractWebComponentDepictor.getBodyStyles()
      • getBodyStyles

        protected java.util.Map<java.lang.String,​java.lang.Object> getBodyStyles()
        Retrieves the styles for the body element of the component.

        This version returns the style for background color.

        This version correctly positions the menu body for non-root menus using absolute positioning.

        Overrides:
        getBodyStyles in class AbstractWebComponentDepictor<C extends Menu>
        Returns:
        The styles for the body element of the component, mapped to CSS property names.
      • depictBegin

        protected void depictBegin()
                            throws java.io.IOException
        Begins the depiction process.

        This version renders the beginning XML element information, if there is any, leaving the beginning tag open for attributes.

        This version writes common XHTML attributes.

        This version wraps the component in a decorator element.

        Overrides:
        depictBegin in class AbstractWebComponentDepictor<C extends Menu>
        Throws:
        java.io.IOException - if there is an error updating the depiction.
      • depictEnd

        protected void depictEnd()
                          throws java.io.IOException
        Ends the depiction process.

        This version renders the ending XML element information, if there is any.

        This version closes the decorator elements.

        Overrides:
        depictEnd in class AbstractWebComponentDepictor<C extends Menu>
        Throws:
        java.io.IOException - if there is an error updating the depiction.