ix.iview.domain
Interface UIObject

All Superinterfaces:
Named
All Known Implementing Classes:
UIRefinement, UIDomain

public interface UIObject
extends Named

A construct that mirrors a domain object and adds UI things. A UIObject has a base object which is its corresponding object in the domain. The contents of this object may change - it is a clone of what is in the domain. The UIObject also has a reference that can be used to identify its corresponding object in the domain (e.g. for a refinement that should be its name). Once this is set, it should not be changed. It will be needed if the domain has to work out what the original is (in case of remove or update operations)


Method Summary
 void addToDomain(Domain domain)
          Adds the contents of this UIObject to the domain (part of publish).
 java.lang.Class getBaseClass()
          Gets the class of objects that can represent this one in the domain.
 IXObject getBaseObject()
          Gets the object that corresponds to this one in the domain.
 java.lang.Object getBaseReference()
          Gets the Id that can be used to identify the base object in the domain.
 Domain getDomain()
          Gets the base domain.
 UIDomain getUIDomain()
          Gets the ui domain of which this object is part.
 boolean hasChanged()
          Determines whether the object has changed since it was last saved to draft
 boolean hasChangedFromOriginal()
          Determines whether the object has changed from its original.
 boolean hasOriginal()
          Determines whether the object has an original in the base domain.
 boolean isEmpty()
          Determines whether the object has any information in it.
 void loadFromDomain()
          Loads the contents of this object from its corresponding domain object.
 void loadFromDomain(java.lang.Object domainObject)
          Loads the contents of this object from the given object.
 void loadFromOriginal()
          Loads the contents of this object from its original domain object.
 IXObject makeBaseObject()
          Makes an empty object of the right class that can represent this UIObject in the domain.
 void moveToUIDomain(UIDomain uiDomain)
          Move the object from its current UIDomain to the given one.
 boolean nameHasChanged(java.lang.Object nameThing)
          Determines whether the object's identifying fields have changed
 void noteChange()
          Get the UIDomain to note the change of this object.
 java.lang.String print()
           
 void removeFromDomain(Domain domain)
          Removes the object's corresponding base object from the domain.
 void saveToDomain()
          Saves the contents of this object into its corresponding domain object.
 void saveToDomain(java.lang.Object domainObject)
          Saves the contents of this object into the given object.
 void setBaseObject(IXObject object)
          Sets the object that will represent this one in the domain.
 void setBaseReference(java.lang.Object id)
          Sets the Id that can be used to identify the base object in the domain.
 void setName(java.lang.String name)
           
 void updateInDomain(Domain domain)
          Updates the base object in the domain with the contents of this object.
 
Methods inherited from interface ix.icore.domain.Named
getName
 

Method Detail

getDomain

public Domain getDomain()
Gets the base domain.

getUIDomain

public UIDomain getUIDomain()
Gets the ui domain of which this object is part.

hasOriginal

public boolean hasOriginal()
Determines whether the object has an original in the base domain.

isEmpty

public boolean isEmpty()
Determines whether the object has any information in it.

hasChangedFromOriginal

public boolean hasChangedFromOriginal()
Determines whether the object has changed from its original.

hasChanged

public boolean hasChanged()
Determines whether the object has changed since it was last saved to draft

nameHasChanged

public boolean nameHasChanged(java.lang.Object nameThing)
Determines whether the object's identifying fields have changed

getBaseReference

public java.lang.Object getBaseReference()
Gets the Id that can be used to identify the base object in the domain.

setBaseReference

public void setBaseReference(java.lang.Object id)
Sets the Id that can be used to identify the base object in the domain.

getBaseObject

public IXObject getBaseObject()
Gets the object that corresponds to this one in the domain.

makeBaseObject

public IXObject makeBaseObject()
Makes an empty object of the right class that can represent this UIObject in the domain.

setBaseObject

public void setBaseObject(IXObject object)
Sets the object that will represent this one in the domain.

getBaseClass

public java.lang.Class getBaseClass()
Gets the class of objects that can represent this one in the domain.

saveToDomain

public void saveToDomain()
Saves the contents of this object into its corresponding domain object. This can be done without worries about the original because if the UIObject has a base object, it is always a clone of the original.

saveToDomain

public void saveToDomain(java.lang.Object domainObject)
Saves the contents of this object into the given object.

loadFromDomain

public void loadFromDomain()
Loads the contents of this object from its corresponding domain object.

loadFromDomain

public void loadFromDomain(java.lang.Object domainObject)
Loads the contents of this object from the given object. The given object should be of the right class (same as the result of getBaseClass()).

loadFromOriginal

public void loadFromOriginal()
Loads the contents of this object from its original domain object.

noteChange

public void noteChange()
Get the UIDomain to note the change of this object.

addToDomain

public void addToDomain(Domain domain)
Adds the contents of this UIObject to the domain (part of publish).

updateInDomain

public void updateInDomain(Domain domain)
Updates the base object in the domain with the contents of this object.

removeFromDomain

public void removeFromDomain(Domain domain)
Removes the object's corresponding base object from the domain.

moveToUIDomain

public void moveToUIDomain(UIDomain uiDomain)
Move the object from its current UIDomain to the given one.

setName

public void setName(java.lang.String name)

print

public java.lang.String print()