Class Blockquote

All Implemented Interfaces:
Animatable<Blockquote>, CanDrop<Blockquote>, Clickable<Blockquote>, Draggable<Blockquote>, HandleMouseEvents<Blockquote>, Scrollable<Blockquote>, Touchable<Blockquote>

Blockquote component

With this component, a blockquote can be displayed on the application interface. A grey line in front of the text marks it as a quote. The source of the quote can also be given, which will be put under the quote text. See the JBStrap showcase for an example.

Supported events:

AnimationStart AnimationEnd, Click, DoubleClick, MouseDown, MouseDown, MouseLeave, MouseMove, MouseOver, MouseOut, MouseUp, Wheel, Scrollable TouchCancel, TouchEnd, TouchMove, TouchStart, Drop, DragStart, DragEnd

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • Blockquote

      public Blockquote(String text)
      Creates a Blockquote component, with the specified text inside it.
      Parameters:
      text - The quote text
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Blockquote

      public Blockquote(String text, String author)
      Creates a Blockquote component, with the specified text and the author’s name inside it.
      Parameters:
      text - The quote text
      author - The author of the quote
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Blockquote

      public Blockquote(String text, String author, String sourceInformation)
      Creates a Blockquote component, with the specified text and the author’s name, and the source of the quote inside it.
      Parameters:
      text - The quote text
      author - The author of the quote
      sourceInformation - The source of the quote (ie: name of a book)
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Blockquote

      public Blockquote(String id, String text, String author, String sourceInformation)
      Creates a Blockquote component, with the specified text and the author’s name, and the source of the quote inside it.
      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.)
      text - The quote text
      author - The author of the quote
      sourceInformation - The source of the quote (ie: name of a book)
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
  • Method Details

    • setText

      public final Blockquote setText(String text)
      Sets the text of the quote
      Parameters:
      text - The quote text
      Returns:
      The blockquote component
    • getText

      public String getText()
      Gets the text of the quote
      Returns:
      The quote text or null, if there is no text
    • getAuthor

      public String getAuthor()
      Gets the author of the quote
      Returns:
      The author of the quote or null, if no author was specified
    • setAuthor

      public final Blockquote setAuthor(String author)
      Sets the author of the quote
      Parameters:
      author - The author of the quote
      Returns:
      The blockquote component
    • getSourceInformation

      public String getSourceInformation()
      Gets the source of the quote
      Returns:
      The source of the quote or null if, no source was specified
    • setSourceInformation

      public final Blockquote setSourceInformation(String sourceInformation)
      Sets the source of the quote
      Parameters:
      sourceInformation - The source of the quote (ie: name of a book)
      Returns:
      The blockquote component
    • 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<Blockquote>
      Returns:
      If the componentwas drawn, true, otherwise false