Class NavBarFooterButton

All Implemented Interfaces:
Clickable<NavBarFooterButton>

public class NavBarFooterButton extends Component<NavBarFooterButton> implements Clickable<NavBarFooterButton>
The footer component is a button that is displayed in the NavBar component’s footer.

You can specify an icon for the component that is to be displayed in the button. You can add any functionality to the button due to its click handler implementation. Also, you can add a popup menu to the button that is displayed to the user when the button is clicked. You can place additional buttons in the popup menu, or items with an image or icon, the click event of which can also be programmed separately. You can thus assign an application logic to each item in the menu system.

Button components are visible markers and you are free to set their color and text. These markers are used to display all sorts of information, e.g. inbox messages or the number of event.

The component is not a standalone component, it is only displayed in the NavBar.

The created and set NavBarFooterButton must be added to the NavBar component using the addFooterButton method.
Since:
4.0
Author:
JBStrap
See Also:
  • Constructor Details

    • NavBarFooterButton

      public NavBarFooterButton(Icon icon)
      Creates a NavBarFooter button component.
      Parameters:
      icon - Set the icon that appears on the button. If null is set, no icon will appear on the button, making the button invisible to the user. For a list of available icons, see the Icon enum.
  • Method Details

    • setIcon

      public NavBarFooterButton setIcon(Icon icon)
      Sets the button icon.
      Parameters:
      icon - Button icon If null is specified, no icon is displayed on the button, making it invisible to users. Available icons are listed in the enum Icon.
      Returns:
      Navbar footer button component
    • getIcon

      public Icon getIcon()
      Gets the icon for the button.
      Returns:
      The icon displayed on the button or null if no icon is displayed on the button
    • setMarkerText

      public NavBarFooterButton setMarkerText(String markerText)
      Shows a default grey marker on the button.
      Parameters:
      markerText - Marker text If null is set, no marker is displayed.
      Returns:
      Navbar footer component
    • setMarker

      public NavBarFooterButton setMarker(String markerText, BadgeType type)
      Shows a marker on the button (marker type specified).
      Parameters:
      markerText - Marker text If null is set, no marker is displayed.
      type - Marker type (color) If null is set, the marker type is not modified. A list of types to be used is contained in the BadgeType enum.
      Returns:
      Navbar footer component
    • getMarkerText

      protected String getMarkerText()
      Gets the text on the button marker.
      Returns:
      Marker text or null if there is no marker text or there is no marker assigned to the button
    • addDoubleClickHandler

      public NavBarFooterButton addDoubleClickHandler(DoubleClickEventHandler handler)
      Adds a double click event handler to the component. This handler runs when the user clicks twice on the component.
      Specified by:
      addDoubleClickHandler in interface Clickable<NavBarFooterButton>
      Parameters:
      handler - A DoubleClickEventHandler implementation
      Returns:
      The component
      See Also:
    • addClickHandler

      public NavBarFooterButton addClickHandler(ClickEventHandler handler)
      Adds a single click event handler to the component. This handler runs when the user clicks once on the component.
      Specified by:
      addClickHandler in interface Clickable<NavBarFooterButton>
      Parameters:
      handler - The ClickEventHandler implementation
      Returns:
      The component
      See Also:
    • createPupup

      public NavBarFooterButtonPopup createPupup()
      Assigns a popup menu to a button.
      Returns:
      An instance of the popup menu created for the button
      See Also:
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<NavBarFooterButton>
      Returns:
      If the componentwas drawn, true, otherwise false