com.flexive.shared.structure
Class FxSelectListItem

java.lang.Object
  extended by com.flexive.shared.structure.FxSelectListItem
All Implemented Interfaces:
ObjectWithColor, ObjectWithLabel, SelectableObject, SelectableObjectWithLabel, java.io.Serializable
Direct Known Subclasses:
FxSelectListItemEdit

public class FxSelectListItem
extends java.lang.Object
implements java.io.Serializable, SelectableObjectWithLabel, ObjectWithColor

Items for select lists

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
protected  ACL acl
           
protected  java.lang.String color
           
protected  java.lang.String data
           
static FxSelectListItem EMPTY
           
protected  long iconId
           
protected  int iconQuality
           
protected  int iconVer
           
protected  long id
           
protected  FxString label
           
protected  LifeCycleInfo lifeCycleInfo
           
protected  FxSelectList list
           
protected  java.lang.String name
           
protected  FxSelectListItem parentItem
           
protected  long parentItemId
           
 
Constructor Summary
FxSelectListItem(long id, java.lang.String name, ACL acl, FxSelectList list, long parentItemId, FxString label, java.lang.String data, java.lang.String color, long iconId, int iconVer, int iconQuality, LifeCycleInfo lifeCycleInfo)
          Internal(!) Constructor to be used while loading from storage
FxSelectListItem(long id, java.lang.String name, FxSelectList list, long parentItemId, FxString label)
          Creates a new in-memory select list item.
 
Method Summary
protected  void _synchronize(FxEnvironment env)
          Internal method to synchronize/load parent items
 FxSelectListItemEdit asEditable()
          Get this FxSelectListItem as editable
 boolean equals(java.lang.Object obj)
          
 ACL getAcl()
          Get the ACL for this item.
 java.lang.String getColor()
          Get the color to display for this item
 java.lang.String getData()
          Get optional data assigned to this item
 long getIconId()
          Id of icon used for user interfaces (reference to binaries, internal field!)
 int getIconQuality()
          Quality of icon used for user interfaces (reference to binaries, internal field!)
 int getIconVer()
          Version of icon used for user interfaces (reference to binaries, internal field!)
 long getId()
          Get the internal id
 FxString getLabel()
          Get label
 LifeCycleInfo getLifeCycleInfo()
          Get this items lifecycle info
 FxSelectList getList()
          Get the list this item belongs to
 java.lang.String getName()
          Get the name of the item.
 FxSelectListItem getParentItem()
          Get the parent item of this item (check existance with hasParentItem() first!)
 int hashCode()
          
 boolean hasParentItem()
          Does a parent item exist for this item?
 boolean isEmpty()
          Is this item used as the "empty" item?
 void setList(FxSelectList list)
          Update this items list (internally used when creating new lists to have a valid id)
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected long id

acl

protected ACL acl

list

protected FxSelectList list

parentItem

protected FxSelectListItem parentItem

parentItemId

protected long parentItemId

name

protected java.lang.String name

label

protected FxString label

data

protected java.lang.String data

color

protected java.lang.String color

iconId

protected long iconId

iconVer

protected int iconVer

iconQuality

protected int iconQuality

lifeCycleInfo

protected LifeCycleInfo lifeCycleInfo

EMPTY

public static final FxSelectListItem EMPTY
Constructor Detail

FxSelectListItem

public FxSelectListItem(long id,
                        java.lang.String name,
                        ACL acl,
                        FxSelectList list,
                        long parentItemId,
                        FxString label,
                        java.lang.String data,
                        java.lang.String color,
                        long iconId,
                        int iconVer,
                        int iconQuality,
                        LifeCycleInfo lifeCycleInfo)
Internal(!) Constructor to be used while loading from storage

Parameters:
id - id
name - name (unique within the list)
acl - the items acl
list - the list this item belongs to
parentItemId - parent item id if >= 0
label - this items label
data - optional data
color - color for display
iconId - id of icon (binary reference)
iconVer - version of icon (binary reference)
iconQuality - quality of icon (binary reference)
lifeCycleInfo - life cycle

FxSelectListItem

public FxSelectListItem(long id,
                        java.lang.String name,
                        FxSelectList list,
                        long parentItemId,
                        FxString label)
Creates a new in-memory select list item. Not suitable for select lists that should be stored in the database.

Parameters:
id - the new select list item ID, possible some external ID
name - name (unique within the list)
list - the select list this item should be added to
parentItemId - the parent item ID, if any
label - the select item label
Method Detail

_synchronize

protected void _synchronize(FxEnvironment env)
Internal method to synchronize/load parent items

Parameters:
env - environment

setList

public void setList(FxSelectList list)
Update this items list (internally used when creating new lists to have a valid id)

Parameters:
list - new list with a valid id

getId

public long getId()
Get the internal id

Specified by:
getId in interface SelectableObject
Returns:
internal id

getName

public java.lang.String getName()
Get the name of the item. The name is unique within the list and can be used as identifier

Returns:
name of the item

getAcl

public ACL getAcl()
Get the ACL for this item. This ACL is treated in a special way: The only relevant permissions are create and delete for adding and removing entries, all items are readable and editable (to allow saving set items) if the create permission is set for the current user and are deselectable if the user has the delete permission.

Returns:
ACL for this item

isEmpty

public boolean isEmpty()
Is this item used as the "empty" item?

Returns:
if this is the "empty" item

getList

public FxSelectList getList()
Get the list this item belongs to

Returns:
list this item belongs to

hasParentItem

public boolean hasParentItem()
Does a parent item exist for this item?

Returns:
parent item exists

getParentItem

public FxSelectListItem getParentItem()
Get the parent item of this item (check existance with hasParentItem() first!)

Returns:
parent item of this item

getLabel

public FxString getLabel()
Get label

Specified by:
getLabel in interface ObjectWithLabel
Returns:
label

getData

public java.lang.String getData()
Get optional data assigned to this item

Returns:
optional data assigned to this item

getColor

public java.lang.String getColor()
Get the color to display for this item

Specified by:
getColor in interface ObjectWithColor
Returns:
color to display for this item

getIconId

public long getIconId()
Id of icon used for user interfaces (reference to binaries, internal field!)

Returns:
id of icon used for user interfaces (reference to binaries, internal field!)

getIconVer

public int getIconVer()
Version of icon used for user interfaces (reference to binaries, internal field!)

Returns:
version of icon used for user interfaces (reference to binaries, internal field!)

getIconQuality

public int getIconQuality()
Quality of icon used for user interfaces (reference to binaries, internal field!)

Returns:
quality of icon used for user interfaces (reference to binaries, internal field!)

getLifeCycleInfo

public LifeCycleInfo getLifeCycleInfo()
Get this items lifecycle info

Returns:
lifecycle info

asEditable

public FxSelectListItemEdit asEditable()
Get this FxSelectListItem as editable

Returns:
FxSelectListItemEdit

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object