com.flexive.shared.tree
Class FxTreeNodeEdit

java.lang.Object
  extended by com.flexive.shared.tree.FxTreeNode
      extended by com.flexive.shared.tree.FxTreeNodeEdit
All Implemented Interfaces:
ObjectWithLabel, SelectableObject, SelectableObjectWithLabel, SelectableObjectWithName, java.io.Serializable, java.lang.Iterable<FxTreeNode>

public class FxTreeNodeEdit
extends FxTreeNode
implements java.io.Serializable

Editable tree node. Make a tree node editable by invoking its #asEditable() method

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

Field Summary
 
Fields inherited from class com.flexive.shared.tree.FxTreeNode
activate, children, data, id, label, lock, mode, name, parentNodeId, PARTIAL_LOADED_POS, PATH_NOT_LOADED, position, reference, referenceLifeCycleInfo, referenceTypeId, ROOT_NODE
 
Constructor Summary
FxTreeNodeEdit(FxTreeNode node)
          Ctor to make a FxTreeNode editable
FxTreeNodeEdit(java.lang.String name)
          Ctor to create a new node attached to the root node
FxTreeNodeEdit(java.lang.String name, long parentNode)
          Ctor to create a new node attached to a parent node
 
Method Summary
 FxTreeNodeEdit activate(boolean includeChildren)
          Prepare this node for activation
 FxTreeNodeEdit asEditable()
          Make this node editable
 FxTreeNodeEdit clearReference()
          Clear the reference, setting it to null
static FxTreeNodeEdit createNew(java.lang.String name)
          Create a new node with the given name
static FxTreeNodeEdit createNewChildNode(FxTreeNode parentNode)
          Create a new editable node that will be the child of the passed node.
 java.lang.String getData()
          Get the template assigned to this node, can be null
 java.lang.String getName()
          Get the name of this node
 FxTreeMode getOriginalMode()
          If the mode was altered, this method will return the original mode
 boolean isActivateWithChildren()
          Activate with children?
 boolean isNew()
          Is this editable tree node for a new or an already existing node?
 FxTreeNodeEdit setChildren(java.util.List<FxTreeNode> children)
          Assign a list of children
 void setData(java.lang.String data)
          Set additional data
 FxTreeNodeEdit setId(long id)
          Sets the node ID to the given value.
 FxTreeNodeEdit setLabel(FxString label)
          Set the label
 FxTreeNodeEdit setMode(FxTreeMode mode)
          Set the tree mode
 FxTreeNodeEdit setName(java.lang.String name)
          Set the name
 FxTreeNodeEdit setParentNodeId(long parentNodeId)
          Set the id of the parent node
 FxTreeNodeEdit setPosition(int position)
          Set this nodes position
 FxTreeNodeEdit setReference(FxPK reference)
          Set the referenced content
 
Methods inherited from class com.flexive.shared.tree.FxTreeNode
_addChild, _applyPath, _applyPosition, createErrorNode, createNewTemporaryChildNode, equals, getACLIds, getChildIds, getChildren, getDepth, getDirectChildCount, getId, getLabel, getLock, getMode, getModifiedAt, getParentNodeId, getPath, getPosition, getReference, getReferenceLifeCycleInfo, getReferenceTypeId, hasData, hashCode, hasReference, isActivate, isDirty, isLeaf, isLive, isMarkForDelete, isMayCreate, isMayDelete, isMayEdit, isMayExport, isMayRelate, isPartialLoaded, isTemporary, iterator, setActivate, setMarkForDelete
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FxTreeNodeEdit

public FxTreeNodeEdit(FxTreeNode node)
Ctor to make a FxTreeNode editable

Parameters:
node - the tree node to make editable

FxTreeNodeEdit

public FxTreeNodeEdit(java.lang.String name)
Ctor to create a new node attached to the root node

Parameters:
name - name of the new node

FxTreeNodeEdit

public FxTreeNodeEdit(java.lang.String name,
                      long parentNode)
Ctor to create a new node attached to a parent node

Parameters:
name - name of the node
parentNode - parent node id
Method Detail

createNewChildNode

public static FxTreeNodeEdit createNewChildNode(FxTreeNode parentNode)
Create a new editable node that will be the child of the passed node. Some assumptions are made: the ACL of the new node is the one of the parent node and the calling user has full access to the referenced content

Parameters:
parentNode - parent node
Returns:
editable node

createNew

public static FxTreeNodeEdit createNew(java.lang.String name)
Create a new node with the given name

Parameters:
name - name of the node
Returns:
editable tree node

isNew

public boolean isNew()
Is this editable tree node for a new or an already existing node?

Returns:
if this editable tree node is for a new or an already existing node

setId

public FxTreeNodeEdit setId(long id)
Sets the node ID to the given value.

Parameters:
id - the node ID
Returns:
this

setReference

public FxTreeNodeEdit setReference(FxPK reference)
Set the referenced content

Parameters:
reference - referenced content
Returns:
this

clearReference

public FxTreeNodeEdit clearReference()
Clear the reference, setting it to null

Returns:
this

getOriginalMode

public FxTreeMode getOriginalMode()
If the mode was altered, this method will return the original mode

Returns:
original mode

activate

public FxTreeNodeEdit activate(boolean includeChildren)
Prepare this node for activation

Parameters:
includeChildren - activate all children as well?
Returns:
this

isActivateWithChildren

public boolean isActivateWithChildren()
Activate with children?

Returns:
activate with children?

setChildren

public FxTreeNodeEdit setChildren(java.util.List<FxTreeNode> children)
Assign a list of children

Parameters:
children - list of children
Returns:
this

setLabel

public FxTreeNodeEdit setLabel(FxString label)
Set the label

Parameters:
label - label
Returns:
this

setName

public FxTreeNodeEdit setName(java.lang.String name)
Set the name

Parameters:
name - name
Returns:
this

setParentNodeId

public FxTreeNodeEdit setParentNodeId(long parentNodeId)
Set the id of the parent node

Parameters:
parentNodeId - id of the parent node
Returns:
this

getName

public java.lang.String getName()
Get the name of this node

Specified by:
getName in interface SelectableObjectWithName
Overrides:
getName in class FxTreeNode
Returns:
name of this node

setMode

public FxTreeNodeEdit setMode(FxTreeMode mode)
Set the tree mode

Parameters:
mode - tree mode
Returns:
this

setPosition

public FxTreeNodeEdit setPosition(int position)
Set this nodes position

Parameters:
position - new position
Returns:
this

getData

public java.lang.String getData()
Get the template assigned to this node, can be null

Overrides:
getData in class FxTreeNode
Returns:
template assigned to this node, can be null

setData

public void setData(java.lang.String data)
Set additional data

Parameters:
data - additional data

asEditable

public FxTreeNodeEdit asEditable()
Description copied from class: FxTreeNode
Make this node editable

Overrides:
asEditable in class FxTreeNode
Returns:
FxTreeNodeEdit