pl.edu.agh.cast.ui.dialogs.property
Class PropertyTreeEntry

java.lang.Object
  extended by pl.edu.agh.cast.ui.dialogs.property.PropertyTreeEntry

public final class PropertyTreeEntry
extends Object

Class which describes single entry in properties tree. It contains one of the two following fields:

One and the only one field from above list is not null.

Author:
AGH CAST Team

Nested Class Summary
static class PropertyTreeEntry.PropertyEditType
          Enumeration of properties entries edition types.
 
Constructor Summary
PropertyTreeEntry(String id, Property<? extends MetaProperty> property, PropertyTreeEntry.PropertyEditType type)
          Constructor for entry with property.
PropertyTreeEntry(String id, Property<? extends MetaProperty> property, PropertyTreeEntry.PropertyEditType type, PropertyTreeEntry parent)
          Constructor for entry with property which sets also parent entry.
PropertyTreeEntry(String id, String label)
          Constructor for entry with label.
PropertyTreeEntry(String id, String label, PropertyTreeEntry parent)
          Constructor for entry with label which sets also parent entry.
 
Method Summary
 void addAllChildren(Map<String,PropertyTreeEntry> childrenToAdd)
          Adds children PropertyTreeEntry entries.
 void addChild(PropertyTreeEntry entry)
          Add child PropertyTreeEntry.
 PropertyTreeEntry getChild(String childId)
          Gets child by given id.
 Collection<PropertyTreeEntry> getChildren()
           
 Map<String,PropertyTreeEntry> getChildrenMap()
          Gets maps of children.
 String getId()
           
 String getLabel()
           
 PropertyTreeEntry getParent()
           
 Property<? extends MetaProperty> getProperty()
           
 PropertyTreeEntry.PropertyEditType getType()
           
 boolean hasChildren()
          Checks if entry has children.
 boolean isMarkAsLabel()
           
 PropertyTreeEntry removeChild(PropertyTreeEntry entry)
          Removes given child.
 void setIsMarkAsLabel(boolean isMarkAsLabel)
           
 void setParent(PropertyTreeEntry parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyTreeEntry

public PropertyTreeEntry(String id,
                         String label)
Constructor for entry with label. The type is set to PropertyTreeEntry.PropertyEditType.CATEGORY.

Parameters:
id - entry id
label - entry label

PropertyTreeEntry

public PropertyTreeEntry(String id,
                         Property<? extends MetaProperty> property,
                         PropertyTreeEntry.PropertyEditType type)
Constructor for entry with property. The type is based on property type.

Parameters:
id - entry id
property - property in this entry
type - entry type based on property type

PropertyTreeEntry

public PropertyTreeEntry(String id,
                         String label,
                         PropertyTreeEntry parent)
Constructor for entry with label which sets also parent entry.

Parameters:
id - entry id
label - entry label
parent - parent entry
See Also:
PropertyTreeEntry(String, String)

PropertyTreeEntry

public PropertyTreeEntry(String id,
                         Property<? extends MetaProperty> property,
                         PropertyTreeEntry.PropertyEditType type,
                         PropertyTreeEntry parent)
Constructor for entry with property which sets also parent entry.

Parameters:
id - entry id
property - property in this entry
type - entry type based on property type
parent - parent entry
See Also:
PropertyTreeEntry(String, Property, PropertyEditType)
Method Detail

getId

public String getId()

getType

public PropertyTreeEntry.PropertyEditType getType()

getLabel

public String getLabel()

isMarkAsLabel

public boolean isMarkAsLabel()

setIsMarkAsLabel

public void setIsMarkAsLabel(boolean isMarkAsLabel)

getProperty

public Property<? extends MetaProperty> getProperty()

setParent

public void setParent(PropertyTreeEntry parent)

getParent

public PropertyTreeEntry getParent()

getChildren

public Collection<PropertyTreeEntry> getChildren()

addChild

public void addChild(PropertyTreeEntry entry)
Add child PropertyTreeEntry. Sets parent in child entry as this.

Parameters:
entry - child entry to add

addAllChildren

public void addAllChildren(Map<String,PropertyTreeEntry> childrenToAdd)
Adds children PropertyTreeEntry entries. Sets parent in all children as this.

Parameters:
childrenToAdd - children entries to add

removeChild

public PropertyTreeEntry removeChild(PropertyTreeEntry entry)
Removes given child.

Parameters:
entry - entry to remove
Returns:
removed entry

hasChildren

public boolean hasChildren()
Checks if entry has children.

Returns:
true if entry has at least one child, false otherwise

getChild

public PropertyTreeEntry getChild(String childId)
Gets child by given id.

Parameters:
childId - entry id
Returns:
child entry

getChildrenMap

public Map<String,PropertyTreeEntry> getChildrenMap()
Gets maps of children.

Returns:
maps of children entries


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.