org.fopps.model
Class ConfigurationItem

java.lang.Object
  |
  +--org.fopps.model.AbstractItem
        |
        +--org.fopps.model.TreeItem
              |
              +--org.fopps.model.ConfigurationItem
Direct Known Subclasses:
Alternative, Option, Parameter

public abstract class ConfigurationItem
extends TreeItem

Base class for all configuration items. A configuration item is an instance of a feature (similar to an object-class relation) in a hierarchical structure.

A configuration item will be disabled, if a parent feature is not selected.


Field Summary
 
Fields inherited from class org.fopps.model.TreeItem
mChildren, mParent
 
Fields inherited from class org.fopps.model.AbstractItem
ADDED_EVENT, CHANGE_EVENT, name, REMOVED_EVENT
 
Constructor Summary
ConfigurationItem(java.lang.String name, ConfigurationItem pParent, Feature pFeature)
          Constructor for ConfigurationItem.
ConfigurationItem(java.lang.String name, ConfigurationItem pParent, java.lang.Object pDefaultValue, Feature pFeature)
          Constructor for ConfigurationItem.
ConfigurationItem(java.lang.String pName, Feature pFeature)
          Creates an ConfigurationItem without parent
ConfigurationItem(java.lang.String pName, TreeItem pParent, boolean pChildrenAllowed, java.lang.Object pDefaultValue, Feature pFeature)
           
 
Method Summary
 void addAttachmentsFromFeature(Feature f)
          Add all attachments from other feature
 void fireItemChanged()
          Passes change events to parent, if necessary.
 java.util.List getAttachments()
          Returns the attachments of the feature
 BindingTime getBinding()
          Returns the binding time of the associated feature
 java.util.Collection getChildrenForConfiguration()
          Returns the needed children for configuration purposes
 java.lang.Object getDefaultValue()
          Returns the default value of the configuration item.
 java.lang.String getDescription()
          Returns the description of the item.
 Feature getFeature()
          Returns the feature this item bases on
 java.lang.String getOrigin()
          Returns the origin (name of the donating asset or product)
 java.lang.String getSymbolicVar()
          Returns the symbolic variable for this configuration item.
abstract  java.lang.Object getValue()
          Returns the current value
 boolean isLocked()
          Returns true, if item is changeable
 boolean isSet()
          Returns true, if configuration item is set.
abstract  java.lang.Object[] possibleValues()
          Returns all possible values of this item
abstract  void restoreDefault()
          Restores default value
 void setDefaultValue(java.lang.Object pDefaultValue)
          Sets the default value of the item.
 void setIsLocked(boolean pIsLocked)
          Sets the isLocked
 void setupInitialConfiguration()
          Setup initial configuration settings.
abstract  boolean setValue(int pIndex)
          Set a value by given index
abstract  boolean setValue(java.lang.Object pValue)
          Set a value by an object value.
abstract  boolean switchToNextValue()
          Switches to next possible value
abstract  boolean switchToPrevValue()
          Switches to next possible value
 java.lang.String toString()
           
 
Methods inherited from class org.fopps.model.TreeItem
addChildren, allChildrenCount, childrenAllowed, childrenCount, delete, first, getChildAt, getChildren, getDepth, getIndexOfChild, getParent, getPath, getRoot, isLeaf, last, notifyListeners, removeAllChildren, removeAllChildrenRecursive, removeChildren, setChildren, setParent
 
Methods inherited from class org.fopps.model.AbstractItem
addIncoming, addListener, addOutgoing, commitGhostRelations, containsType, copyAttributes, filterElements, fireItemAdded, fireItemRemoved, getConstraints, getIncoming, getIncomingConstraints, getListeners, getName, getOutgoing, getOutgoingConstraints, getRelationTo, hasConstraints, isBlockEvents, isConnectedWith, removeAllConstraints, removeAllIncoming, removeAllListener, removeAllOutgoing, removeAllRelations, removeGhostRelations, removeIncoming, removeListener, removeOutgoing, removeRelationTo, setBlockEvents, setDescription, setIncoming, setName, setOutgoing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfigurationItem

public ConfigurationItem(java.lang.String pName,
                         Feature pFeature)
Creates an ConfigurationItem without parent


ConfigurationItem

public ConfigurationItem(java.lang.String name,
                         ConfigurationItem pParent,
                         Feature pFeature)
Constructor for ConfigurationItem.

Parameters:
name - Name of configuration item
pParent - Parent node

ConfigurationItem

public ConfigurationItem(java.lang.String pName,
                         TreeItem pParent,
                         boolean pChildrenAllowed,
                         java.lang.Object pDefaultValue,
                         Feature pFeature)

ConfigurationItem

public ConfigurationItem(java.lang.String name,
                         ConfigurationItem pParent,
                         java.lang.Object pDefaultValue,
                         Feature pFeature)
Constructor for ConfigurationItem.

Parameters:
name - Name of configuration item
pParent - Parent node
Method Detail

getFeature

public Feature getFeature()
Returns the feature this item bases on


addAttachmentsFromFeature

public void addAttachmentsFromFeature(Feature f)
Add all attachments from other feature


getBinding

public BindingTime getBinding()
Returns the binding time of the associated feature


getDescription

public java.lang.String getDescription()
Returns the description of the item. Equals the feature description

Overrides:
getDescription in class AbstractItem
Returns:
Description of the project

getAttachments

public java.util.List getAttachments()
Returns the attachments of the feature


getOrigin

public java.lang.String getOrigin()
Returns the origin (name of the donating asset or product)


getSymbolicVar

public java.lang.String getSymbolicVar()
Returns the symbolic variable for this configuration item. This attribute is used as key to identify a configuration entry. So it must be unique in the scope of a product configuration.


isLocked

public boolean isLocked()
Returns true, if item is changeable

Returns:
boolean

isSet

public boolean isSet()
Returns true, if configuration item is set. This method returns always true


setIsLocked

public void setIsLocked(boolean pIsLocked)
Sets the isLocked


getChildrenForConfiguration

public java.util.Collection getChildrenForConfiguration()
Returns the needed children for configuration purposes


getDefaultValue

public java.lang.Object getDefaultValue()
Returns the default value of the configuration item. If null, the default value depends on the subclasses behaviour.


setDefaultValue

public void setDefaultValue(java.lang.Object pDefaultValue)
Sets the default value of the item. The actual value is not changed.

Parameters:
pDefaultValue - New default value. Must be accepted by setValue
See Also:
restoreDefault(), setValue(Object)

restoreDefault

public abstract void restoreDefault()
Restores default value


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

switchToNextValue

public abstract boolean switchToNextValue()
Switches to next possible value

Returns:
true, if value was changed

switchToPrevValue

public abstract boolean switchToPrevValue()
Switches to next possible value

Returns:
true, if value was changed

setValue

public abstract boolean setValue(int pIndex)
Set a value by given index

Parameters:
pIndex - Index to select
Returns:
true, if value was changed

setValue

public abstract boolean setValue(java.lang.Object pValue)
Set a value by an object value. Every subclass should at least support strings

Parameters:
pValue - New value
Returns:
true, if value was changed

possibleValues

public abstract java.lang.Object[] possibleValues()
Returns all possible values of this item


getValue

public abstract java.lang.Object getValue()
Returns the current value


setupInitialConfiguration

public void setupInitialConfiguration()
Setup initial configuration settings. Should be called after the configuration tree is complete


fireItemChanged

public void fireItemChanged()
Passes change events to parent, if necessary. If no parent present, it invokes the method from the superclass

Overrides:
fireItemChanged in class AbstractItem
See Also:
AbstractItem.setBlockEvents(boolean)


Fopps 0.19 - Copyright © 2002 Oliver Wieland. All Rights Reserved.