Class Breadcrumb

All Implemented Interfaces:
Animatable<Breadcrumb>, CanDrop<Breadcrumb>, Draggable<Breadcrumb>, HandleMouseEvents<Breadcrumb>, Scrollable<Breadcrumb>

Breadcrumb component

The component helps the user to track where they are in the application. The component is only usable, if the pages are opened with a page cache.

The component lists the pages, in the order they were opened (chronologically). Each element is clickable, and the user can navigate to those pages. Pages cached like this, will also store their state, so when the user navigates back to it through the Breadcrumb component it will be the same(for example, the scrollbar, the state and contents of the components will be the same).

Supported events:

AnimationStart AnimationEnd, MouseDown, MouseDown, MouseLeave, MouseMove, MouseOver, MouseOut, MouseUp, Wheel, Scrollable Drop, DragStart, DragEnd

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • Breadcrumb

      public Breadcrumb()
      Creates a breadcrumb component
    • Breadcrumb

      public Breadcrumb(String id)
      Creates a breadcrumb component with specified ID
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
  • Method Details

    • afterDraw

      public void afterDraw()
      Description copied from class: Component
      The operations to be executed after the drawing of the component

      By default, this is an empty method. It has to be overwritten on a component or page if additional operations have to be executed after the drawing process. One such operation is data retrieval, which shouldn't run in constructors so that the user could see results of an operation or navigation process.

      Overrides:
      afterDraw in class Component<Breadcrumb>
    • refresh

      public Breadcrumb refresh()
      Refreshes the component
      Returns:
      The breadcrumb component
    • addComponent

      public Breadcrumb addComponent(Component component)

      DO NOT USE THIS METHOD

      Adds a component to the Breadcrumb. This is an inherited method and is disabled in the Breadcrumb class. No additional components can be added to the Breadcrumb.

      Overrides:
      addComponent in class Component<Breadcrumb>
      Parameters:
      component - The component to be added
      Returns:
      The component
      Throws:
      UnsupportedOperationException - Every time this method is called
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      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<Breadcrumb>
      Returns:
      If the componentwas drawn, true, otherwise false
    • openPage

      public Breadcrumb openPage(String pageId)
      Open a new tab based on breadcrumb
      Parameters:
      pageId - The target page id
      Returns:
      The breadcrumb component
      Throws:
      NullPointerException - If the specified page id was null, or if the page id was not found
    • openPage

      public Breadcrumb openPage(String pageId, Parameters parameters)
      Open a new tab based on breadcrumb
      Parameters:
      pageId - The target page id
      parameters - The parameters object for the target page
      Returns:
      The breadcrumb component
      Throws:
      NullPointerException - If the specified page id was null, or if the page id was not found