org.oddjob.arooa.design
Class DesignComponentBase

java.lang.Object
  extended by org.oddjob.arooa.design.DesignComponentBase
All Implemented Interfaces:
DesignComponent, DesignInstance, ParsableDesignInstance
Direct Known Subclasses:
BaseDC

public abstract class DesignComponentBase
extends Object
implements DesignComponent

Shared implementation for the designs of instances that are components. The common implementation is mainly about notify listeners of structural changes.

Author:
rob

Constructor Summary
DesignComponentBase(ArooaElement element, ArooaClass classIdentifier, ArooaContext parentContext)
           
DesignComponentBase(ArooaElement element, ArooaContext parentContext)
          Constructor.
 
Method Summary
 void addStructuralListener(DesignListener listener)
          Add a listener that will notified when child DesignComponents are added or removed from this DesignComponent.
 ArooaElement element()
          Required for producing the XML.
 ArooaContext getArooaContext()
          Get the ArooaContext associated with this instance.
 String getId()
          Get the id of the instance, if there is one.
 void removeStructuralListener(DesignListener listener)
          Remove a listener.
 void setId(String id)
          Set the id of the instance.
 QTag tag()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.oddjob.arooa.design.DesignInstance
detail, element, getArooaContext
 
Methods inherited from interface org.oddjob.arooa.design.ParsableDesignInstance
children
 

Constructor Detail

DesignComponentBase

public DesignComponentBase(ArooaElement element,
                           ArooaContext parentContext)
Constructor.

Parameters:
element -
parentContext -

DesignComponentBase

public DesignComponentBase(ArooaElement element,
                           ArooaClass classIdentifier,
                           ArooaContext parentContext)
Parameters:
element -
classIdentifier -
parentContext -
Method Detail

addStructuralListener

public void addStructuralListener(DesignListener listener)
Description copied from interface: DesignComponent
Add a listener that will notified when child DesignComponents are added or removed from this DesignComponent. This is used by the DesignTreeModel.

Specified by:
addStructuralListener in interface DesignComponent
Parameters:
listener - The listener.

removeStructuralListener

public void removeStructuralListener(DesignListener listener)
Description copied from interface: DesignComponent
Remove a listener.

Specified by:
removeStructuralListener in interface DesignComponent
Parameters:
listener - The listener.

getId

public String getId()
Description copied from interface: DesignComponent
Get the id of the instance, if there is one.

Specified by:
getId in interface DesignComponent
Returns:
The id. May be null.

setId

public void setId(String id)
Description copied from interface: DesignComponent
Set the id of the instance.

Specified by:
setId in interface DesignComponent
Parameters:
id - The id. May be null.

element

public ArooaElement element()
Description copied from interface: DesignInstance
Required for producing the XML.

Specified by:
element in interface DesignInstance
Returns:
The element.

tag

public QTag tag()

getArooaContext

public ArooaContext getArooaContext()
Description copied from interface: DesignInstance
Get the ArooaContext associated with this instance.

Specified by:
getArooaContext in interface DesignInstance
Returns:
The context. Never null.

toString

public String toString()
Overrides:
toString in class Object