Class ItemDataRole

java.lang.Object
eu.webtoolkit.jwt.ItemDataRole
All Implemented Interfaces:
Comparable<ItemDataRole>

public final class ItemDataRole extends Object implements Comparable<ItemDataRole>
Enumeration that indicates a role for a data item.

A single data item can have data associated with it corresponding to different roles. Each role may be used by the corresponding view class in a different way.

See Also:
  • Field Details

    • Display

      public static final ItemDataRole Display
      Role for textual representation (0).
    • Decoration

      public static final ItemDataRole Decoration
      Role for the url of an icon (1).
    • Edit

      public static final ItemDataRole Edit
      Role for the edited value (2).
    • StyleClass

      public static final ItemDataRole StyleClass
      Role for the style class (3).
    • Checked

      public static final ItemDataRole Checked
      Role that indicates the check state (4).

      Data for this role should be a bool. When the Wt::ItemIsTristate flag is set for the item, data for this role should be of type CheckState.

    • ToolTip

      public static final ItemDataRole ToolTip
      Role for a (plain) tooltip (5).
    • MimeType

      public static final ItemDataRole MimeType
      Role for mime type information (7).
    • Level

      public static final ItemDataRole Level
      Level in aggregation, for header data (8).
    • MarkerPenColor

      public static final ItemDataRole MarkerPenColor
      Marker pen color (for WCartesianChart) (16).
    • MarkerBrushColor

      public static final ItemDataRole MarkerBrushColor
      Marker brush color (for WCartesianChart) (17).
    • MarkerScaleFactor

      public static final ItemDataRole MarkerScaleFactor
      Marker size (for WCartesianChart) (20).
    • MarkerType

      public static final ItemDataRole MarkerType
      Marker type (for WCartesianChart) (21).
    • BarPenColor

      public static final ItemDataRole BarPenColor
      Bar pen color (for WCartesianChart) (18).
    • BarBrushColor

      public static final ItemDataRole BarBrushColor
      Bar brush color (for WCartesianChart) (19).
    • User

      public static final ItemDataRole User
      First role reserved for user purposes (32).
  • Constructor Details

    • ItemDataRole

      public ItemDataRole(int role)
      Create a new role with a certain int value.

      JWt's roles are < 32. User defined roles should be >e; 32.

  • Method Details

    • of

      public static ItemDataRole of(int role)
      Returns the canonical ItemDataRole for the given numeric value.

      If the role is one of the predefined roles, that instance is returned, otherwise a new role is created, so the following is true for all predefined roles:

      
       ItemDataRole.of(0).equals(ItemDataRole.Display) &&
       ItemDataRole.of(0) == ItemDataRole.Display
       
    • getValue

      public int getValue()
      Returns the underlying int of this role.
    • equals

      public boolean equals(Object rhs)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(ItemDataRole rhs)
      Specified by:
      compareTo in interface Comparable<ItemDataRole>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object