Class ActivityStreamItem

java.lang.Object
com.jbstrap.core.messagebus.MessageBus
com.jbstrap.ui.Component<ActivityStreamItem>
com.jbstrap.ui.components.activitystream.ActivityStreamItem
All Implemented Interfaces:
Animatable<ActivityStreamItem>, CanDrop<ActivityStreamItem>, Clickable<ActivityStreamItem>, Draggable<ActivityStreamItem>, HandleMouseEvents<ActivityStreamItem>, Scrollable<ActivityStreamItem>, Touchable<ActivityStreamItem>

Activity stream item component

This component cannot be used on its own. This components represents an ActivityStream item. This is where the item's data and settings can be specified, but it cannot be used or displayed on its own.

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:
JBStrep
See Also:
  • Constructor Details

    • ActivityStreamItem

      public ActivityStreamItem(Object id, Date time)
      Creates an activity stream item, with the specified ID and time.
      Parameters:
      id - The unique id of the item
      time - The item time
      Throws:
      NullPointerException - If the id or time is null
  • Method Details

    • getTime

      public Date getTime()
      Gets the item time
      Returns:
      The item time
    • getItemId

      public Object getItemId()
      Gets the item ID
      Returns:
      The item ID
    • getParentItem

      public ActivityStreamItem getParentItem()
      Gets the item's parent item
      Returns:
      The parent item instance or null, if not found
    • setParentItem

      public ActivityStreamItem setParentItem(ActivityStreamItem parentItem)
      Sets the item's parent item
      Parameters:
      parentItem - The parent item instance. If null, the item will be a root item
      Returns:
      The activity stream item
    • getLevel

      public final int getLevel()
      Gets the item level. Root level is 0.
      Returns:
      The item level
    • 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<ActivityStreamItem>
      Returns:
      If the componentwas drawn, true, otherwise false