com.flexive.shared.structure
Class FxSelectListEdit

java.lang.Object
  extended by com.flexive.shared.structure.FxSelectList
      extended by com.flexive.shared.structure.FxSelectListEdit
All Implemented Interfaces:
ObjectWithLabel, java.io.Serializable

public class FxSelectListEdit
extends FxSelectList
implements java.io.Serializable

Editable select list

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

Field Summary
 
Fields inherited from class com.flexive.shared.structure.FxSelectList
allowDynamicItemCreation, COUNTRIES, createItemACL, defaultItem, defaultItemId, description, id, items, label, name, newItemACL, parentList, parentListId
 
Constructor Summary
FxSelectListEdit(FxSelectList list)
          Constructor
FxSelectListEdit(FxSelectList parent, java.lang.String name, FxString label, FxString description, boolean allowDynamicItemCreation, ACL createItemACL, ACL newItemACL, FxSelectListItem defaultItem)
          Constructor for creating a new list
 
Method Summary
 void _synchronizeId(long newId)
          Assign an id for a new created list to be synchronized with items
 void addAll(java.util.List<? extends SelectableObjectWithLabel> items)
          Adds all given objects to this select list.
 void addAllWithName(java.util.List<? extends SelectableObjectWithName> items)
          Adds all given objects to this select list.
 void addItem(FxSelectListItem item)
          adds a new item to the select list.
 boolean changes()
          Have any changes been made?
static FxSelectListEdit createNew(FxSelectList parent, java.lang.String name, FxString label, FxString description, boolean allowDynamicItemCreation, ACL createItemACL, ACL defaultItemACL)
          Helper method to create a new FxSelectListEdit instance
static FxSelectListEdit createNew(java.lang.String name, FxString label, FxString description, boolean allowDynamicItemCreation, ACL createItemACL, ACL defaultItemACL)
          Helper method to create a new FxSelectListEdit instance
 java.util.List<FxSelectListItemEdit> getEditableItems()
          returns all list items as editable list items.
 boolean isNew()
          Is this a new list?
 void removeItem(java.lang.Long id)
          Removes the item with Id from the items map.
 FxSelectListEdit setDefaultItem(FxSelectListItem defaultItem)
          Set a new default item, setting null will clear the default item
 void setDescription(FxString description)
          Set the description
 void setLabel(FxString label)
          Set the label
 void setName(java.lang.String name)
          Set the name - has to be unique!
 
Methods inherited from class com.flexive.shared.structure.FxSelectList
_setDefaultItem, _synchronize, asEditable, containsItem, containsItem, createList, createListWithName, getCreateItemACL, getDefaultItem, getDescription, getId, getItem, getItem, getItemByData, getItemMap, getItems, getLabel, getName, getNewItemACL, getParentList, hasDefaultItem, hasParentList, isAllowDynamicItemCreation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxSelectListEdit

public FxSelectListEdit(FxSelectList list)
Constructor

Parameters:
list - the list to make editable

FxSelectListEdit

public FxSelectListEdit(FxSelectList parent,
                        java.lang.String name,
                        FxString label,
                        FxString description,
                        boolean allowDynamicItemCreation,
                        ACL createItemACL,
                        ACL newItemACL,
                        FxSelectListItem defaultItem)
Constructor for creating a new list

Parameters:
parent - parent list if not null
name - name - has to be unique!
label - label
description - description
allowDynamicItemCreation - is dynamic item creation allowed?
createItemACL - ACL whose create flag is checked against for creating new list items
newItemACL - ACL assigned to new items
defaultItem - the default selected item, optional, can be null
Method Detail

isNew

public boolean isNew()
Is this a new list?

Returns:
is a new list?

changes

public boolean changes()
Have any changes been made?

Returns:
changes made?

setName

public void setName(java.lang.String name)
Set the name - has to be unique!

Parameters:
name - name

setLabel

public void setLabel(FxString label)
Set the label

Parameters:
label - label

setDescription

public void setDescription(FxString description)
Set the description

Parameters:
description - description

setDefaultItem

public FxSelectListEdit setDefaultItem(FxSelectListItem defaultItem)
Set a new default item, setting null will clear the default item

Parameters:
defaultItem - a new default item, setting null will clear the default item
Returns:
this

getEditableItems

public java.util.List<FxSelectListItemEdit> getEditableItems()
returns all list items as editable list items.

Returns:
a list of editable list items.

addItem

public void addItem(FxSelectListItem item)
adds a new item to the select list.

Parameters:
item - the item to add to the select list

removeItem

public void removeItem(java.lang.Long id)
Removes the item with Id from the items map.

Parameters:
id - id of the item to remove

addAll

public void addAll(java.util.List<? extends SelectableObjectWithLabel> items)
Adds all given objects to this select list.

Parameters:
items - the objects to be added

addAllWithName

public void addAllWithName(java.util.List<? extends SelectableObjectWithName> items)
Adds all given objects to this select list.

Parameters:
items - the objects to be added

_synchronizeId

public void _synchronizeId(long newId)
Assign an id for a new created list to be synchronized with items

Parameters:
newId - new list id

createNew

public static FxSelectListEdit createNew(java.lang.String name,
                                         FxString label,
                                         FxString description,
                                         boolean allowDynamicItemCreation,
                                         ACL createItemACL,
                                         ACL defaultItemACL)
Helper method to create a new FxSelectListEdit instance

Parameters:
name - name - has to be unique!
label - label
description - description
allowDynamicItemCreation - is dynamic item creation allowed?
createItemACL - ACL whose create flag is checked against for creating new list items
defaultItemACL - ACL assigned to new items
Returns:
FxSelectListEdit

createNew

public static FxSelectListEdit createNew(FxSelectList parent,
                                         java.lang.String name,
                                         FxString label,
                                         FxString description,
                                         boolean allowDynamicItemCreation,
                                         ACL createItemACL,
                                         ACL defaultItemACL)
Helper method to create a new FxSelectListEdit instance

Parameters:
parent - parent list if not null
name - name - has to be unique!
label - label
description - description
allowDynamicItemCreation - is dynamic item creation allowed?
createItemACL - ACL whose create flag is checked against for creating new list items
defaultItemACL - ACL assigned to new items
Returns:
FxSelectListEdit