Class AbstractWebMenuDepictor<C extends Menu>

Type Parameters:
C - The type of component being depicted.
All Implemented Interfaces:
ComponentDepictor<C>, Depictor<C>, WebComponentDepictor<C>, WebDepictor<C>
Direct Known Subclasses:
WebAccordionMenuDepictor, WebDropMenuDepictor

public abstract class AbstractWebMenuDepictor<C extends Menu> extends AbstractWebLayoutComponentDepictor<C>
Abstract strategy for rendering a menu.
Author:
Garret Wilson
  • Constructor Details

    • AbstractWebMenuDepictor

      public AbstractWebMenuDepictor()
      Default constructor with no element representation.
    • AbstractWebMenuDepictor

      public AbstractWebMenuDepictor(URI namespaceURI, String localName)
      Element namespace and local name constructor that doesn't create an empty element, even if there is no content.
      Parameters:
      namespaceURI - The URI of the XML namespace of the element, or null if there is no namespace.
      localName - The local name of the element with no prefix, or null if this component should not be rendered as an element.
    • AbstractWebMenuDepictor

      public AbstractWebMenuDepictor(URI namespaceURI, String localName, boolean isEmptyElementAllowed)
      Element namespace and local name constructor.
      Parameters:
      namespaceURI - The URI of the XML namespace of the element, or null if there is no namespace.
      localName - The local name of the element with no prefix, or null if this component should not be rendered as an element.
      isEmptyElementAllowed - Whether an empty element can be created if there is no content.
  • Method Details

    • processEvent

      public void processEvent(PlatformEvent event)
      Processes an event from the platform.
      Specified by:
      processEvent in interface Depictor<C extends Menu>
      Overrides:
      processEvent in class AbstractComponentDepictor<C extends Menu>
      Parameters:
      event - The event to be processed.
      Throws:
      IllegalArgumentException - if the given event is a relevant DepictEvent with a source of a different depicted object.
    • getBaseStyleIDs

      protected Set<String> getBaseStyleIDs(String prefix, String suffix)
      Retrieves the base style IDs for the given component.

      This version returns the default style ID and the specified component style ID, if any.

      If the component is Selectable and is selected, the GuiseCSSStyleConstants.SELECTED_CLASS is returned.

      This version adds attributes based upon the menu axis and orientation, as well as whether the menu is open and/or in a rollover state.

      Overrides:
      getBaseStyleIDs in class AbstractWebComponentDepictor<C extends Menu>
      Parameters:
      prefix - The prefix that needs to be added to each, or null if there is no prefix to add.
      suffix - The suffix that needs to be added to each, or null if there is no suffix to add.
      Returns:
      The base style IDs for the component.