com.dat.cx
Class CxVarHolder

java.lang.Object
  |
  +--com.dat.cx.CxComponent
        |
        +--com.dat.cx.CxCompositeComponent
              |
              +--com.dat.cx.CxVarHolder
All Implemented Interfaces:
CxComponentChangeListener, CxComponentChildrenListener, CxDataMgr, CxExtendsListener, CxVariableManager, java.util.EventListener, com.d_a_t.expeval.ExpressionContext

public class CxVarHolder
extends CxCompositeComponent
implements CxDataMgr, CxComponentChangeListener, CxComponentChildrenListener

CxVarHolder provides semantics for a data manager component.


Inner Class Summary
 class CxVarHolder.Data
          Data is a context managed instance of result set and the current stored xml document
 
Fields inherited from class com.dat.cx.CxComponent
compactDisplay, noHatDisplay, standardDisplay
 
Constructor Summary
CxVarHolder()
           
CxVarHolder(java.lang.String name)
          Constructor
 
Method Summary
 void addDocChangedListener(CxDocChangedListener listener)
           
 void addInitChangedListener(CxDocChangedListener listener)
           
 void componentChanged(CxComponentChangeEvent evt)
          Receive a CxComponentChangeEvent
 void componentChildAdded(CxComponentChildrenEvent evt)
          Receive a CxComponentChildrenEvent when a child has been added
 void componentChildRemoved(CxComponentChildrenEvent evt)
          Receive a CxComponentChildrenEvent when a child has been removed
 java.lang.Object createData()
          Create an instance of context managed data.
 void docReceived(CxEvent event)
           
 XSet export(XSet doc, CxProject project)
          Export the definition of this variable.
 void fireDocChanged(com.dat.cx.Node doc)
           
 void fireInitChanged(com.dat.cx.Node doc)
           
 java.lang.Object getData(CxContext context)
          Get context data
 java.lang.Object getData(CxEvent evt)
          Get context data
 com.dat.cx.studio.CxCompDisplay getDisplay()
          Get the display peer for this var holder.
 com.dat.cx.Node getDoc(CxContext context)
          get the saved context managed document
 com.dat.cx.Node getDoc(CxEvent xevt)
          get the saved context managed document
 java.lang.String getIcon()
          Get the icon file name for this port
 com.dat.cx.Node getInit()
           
 com.dat.cx.Node getNode(CxVarHolder.Data data)
           
 CxVar getVariable()
          Returns the document type which is manage by this component.
 boolean hasOverride()
          Determine if the inherited component has an override.
 java.util.Vector importSpec(XSet spec)
          Import specification from an XML element
 void importTemplate(CxComponent from, boolean copy, boolean inherit, boolean inverse)
          Import the definition of a component from another component.
 boolean isDataMgr()
          Determines if the component is a data manager
 void removeDocChangedListener(CxDocChangedListener listener)
           
 void removeInitChangedListener(CxDocChangedListener listener)
           
 com.d_a_t.expeval.EEField resolveField(java.lang.String identifier)
          Augmented to resolve any name which has a port name == field name in the data class as a field.
 void setDoc(com.dat.cx.Node doc, CxContext context)
          Set the data to the value of a given document
 void setDoc(com.dat.cx.Node doc, CxEvent xevt)
          Set the data to the value of a given document
 void setInit(com.dat.cx.Node newInit)
           
 void setInitNoUndo(com.dat.cx.Node node)
           
 void setSavedDoc(CxVarHolder.Data data, com.dat.cx.Node node)
           
 
Methods inherited from class com.dat.cx.CxCompositeComponent
exportInfo, getCatchPort, getErrorPort, importInfo, isCompositeComponent, makeInfo, setIcon
 
Methods inherited from class com.dat.cx.CxComponent
activate, addChild, addChildAt, addChildAtNoUndo, addChildNoUndo, addChildNoUndoAssign, addComponentChangeListener, addComponentChildrenListener, addExtendsListener, addSortedChild, canAddComponent, canExtendsAdd, componentAdded, componentLocationChanged, componentNameChanged, componentNodeChanged, componentPropertyChanged, componentRemoved, componentWirePortChanged, constructNode, contains, deactivate, decrUnresolved, exportContent, findPath, findPath, getBaseType, getChild, getChild, getChildren, getClassClause, getConfig, getConfigValue, getConfigValue, getDataPath, getDataPort, getDisplayStyle, getEditFrame, getExtendsFrom, getExtendsListeners, getImageIcon, getIndexOfChild, getInfo, getName, getNameInAncestor, getNameInContext, getNextChildTo, getNoChildren, getOwnerProject, getPackage, getPackage, getParent, getPort, getPropertyNames, getPropertyValues, getRoot, getRzChildren, getRzSortedChildren, getSortedChild, getSortedChildren, getSortedIndexOfChild, getViewFrame, getX, getXmlType, getY, handleException, hasChild, hasChild, hasChildren, hasDisplay, hasProperties, importContent, incrUnresolved, init, instantiateChildComponent, instantiateChildComponentAt, isActive, isAttribute, isAttributeInstance, isBaseProperty, isConfiguration, isContentComponent, isDataPort, isErrorCatchPort, isExtendable, isExtended, isInherited, isInterface, isLibraryComponent, isMiniPort, isName, isNative, isPackage, isPalette, isPin, isPort, isPortMgr, isProperty, isRoot, isSubPortOf, isTextInstance, isTypePackage, isVar, isVarInstance, isVarSet, isWire, isXmlPort, isXmlPrimative, isXmlString, omitExport, removeChild, removeChild, removeChildNoUndo, removeComponentChangeListener, removeComponentChildrenListener, removeExtendsListener, renameSortedChild, resolveClass, resolveConstructor, resolveMethod, setClassClause, setComponentDefinitionServer, setDisplayStyle, setDisplayStyleFromInfo, setExtendsFrom, setInherited, setLocation, setLocationNoUndo, setName, setNameNoTrigger, setNameNoUndo, setNative, setOwnerProject, setParent, setPropertyValues, setX, setY, toString, triggerExtendsNodeChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.dat.cx.CxDataMgr
findPath, getDataPort, getName
 

Constructor Detail

CxVarHolder

public CxVarHolder()

CxVarHolder

public CxVarHolder(java.lang.String name)
Constructor
Parameters:
name - the name for the data manager
Method Detail

createData

public java.lang.Object createData()
Create an instance of context managed data.

setSavedDoc

public void setSavedDoc(CxVarHolder.Data data,
                        com.dat.cx.Node node)

setDoc

public void setDoc(com.dat.cx.Node doc,
                   CxEvent xevt)
Set the data to the value of a given document
Specified by:
setDoc in interface CxDataMgr
Parameters:
doc - the root node of the doc to be saved
xevt - the event containing the context managed data

setDoc

public void setDoc(com.dat.cx.Node doc,
                   CxContext context)
Set the data to the value of a given document
Specified by:
setDoc in interface CxDataMgr
Parameters:
doc - the root node of the doc to be saved
context - the context managed data

getNode

public com.dat.cx.Node getNode(CxVarHolder.Data data)

getDoc

public com.dat.cx.Node getDoc(CxEvent xevt)
get the saved context managed document
Specified by:
getDoc in interface CxDataMgr
Parameters:
xevt - the evnt containing the context managed data

getDoc

public com.dat.cx.Node getDoc(CxContext context)
get the saved context managed document
Specified by:
getDoc in interface CxDataMgr
Parameters:
xevt - the evnt containing the context managed data

getData

public java.lang.Object getData(CxEvent evt)
Get context data
Parameters:
event - source event containing the context
Returns:
context data as defined by create data

getData

public java.lang.Object getData(CxContext context)
Get context data
Parameters:
context - the source context
Returns:
context data as defined by create data

getDisplay

public com.dat.cx.studio.CxCompDisplay getDisplay()
Get the display peer for this var holder. The display peer handles the rendering of the var holder within the studio.
Overrides:
getDisplay in class CxComponent
Returns:
the display peer

getVariable

public CxVar getVariable()
Returns the document type which is manage by this component.
Specified by:
getVariable in interface CxVariableManager

isDataMgr

public boolean isDataMgr()
Determines if the component is a data manager
Overrides:
isDataMgr in class CxComponent
Returns:
true if the component is a pin, otherwise false

componentChanged

public void componentChanged(CxComponentChangeEvent evt)
Description copied from interface: CxComponentChangeListener
Receive a CxComponentChangeEvent
Specified by:
componentChanged in interface CxComponentChangeListener
Following copied from interface: com.dat.cx.CxComponentChangeListener
Parameters:
event - the recieved event.

componentChildAdded

public void componentChildAdded(CxComponentChildrenEvent evt)
Description copied from interface: CxComponentChildrenListener
Receive a CxComponentChildrenEvent when a child has been added
Specified by:
componentChildAdded in interface CxComponentChildrenListener
Following copied from interface: com.dat.cx.CxComponentChildrenListener
Parameters:
event - the receieved CxComponentChildrenEvent

componentChildRemoved

public void componentChildRemoved(CxComponentChildrenEvent evt)
Description copied from interface: CxComponentChildrenListener
Receive a CxComponentChildrenEvent when a child has been removed
Specified by:
componentChildRemoved in interface CxComponentChildrenListener
Following copied from interface: com.dat.cx.CxComponentChildrenListener
Parameters:
event - the receieved CxComponentChildrenEvent

importTemplate

public void importTemplate(CxComponent from,
                           boolean copy,
                           boolean inherit,
                           boolean inverse)
Import the definition of a component from another component. For composite components this will result in instantiating new child components for each of the children of the from component and importing their definition recursively. Note: special handing is provided by each subclass, CxPort, CxInterface, CxProperty, CxLibraryComponent, etc.
Overrides:
importTemplate in class CxComponent
Parameters:
from - the component from which to import a definition
copy - indicate that this is a copy 'vs' extends
inherit - indicate that the definition is inherited as part of an extends
inverse - indicate that polarity is to be inversed (see CxPort and CxInterface)

importSpec

public java.util.Vector importSpec(XSet spec)
Import specification from an XML element
Overrides:
importSpec in class CxComponent
Parameters:
spec - the xml element containing the specification
Returns:
Vector of exception nodes, DOM nodes that have been processed as part of this import and should not be processed by the component factory

export

public XSet export(XSet doc,
                   CxProject project)
Export the definition of this variable.
Overrides:
export in class CxComponent
Parameters:
doc - the XSet docuement being constructed. The definition is added to this document.
Returns:
the XSet document relative to the new definition

hasOverride

public boolean hasOverride()
Determine if the inherited component has an override. That is a property or x/y that is different from the component it was extended from
Overrides:
hasOverride in class CxComponent
Returns:
true if the component has an override, otherwise false

docReceived

public void docReceived(CxEvent event)
Specified by:
docReceived in interface CxDataMgr

addDocChangedListener

public void addDocChangedListener(CxDocChangedListener listener)
Specified by:
addDocChangedListener in interface CxDataMgr

removeDocChangedListener

public void removeDocChangedListener(CxDocChangedListener listener)
Specified by:
removeDocChangedListener in interface CxDataMgr

fireDocChanged

public void fireDocChanged(com.dat.cx.Node doc)

addInitChangedListener

public void addInitChangedListener(CxDocChangedListener listener)
Specified by:
addInitChangedListener in interface CxDataMgr

removeInitChangedListener

public void removeInitChangedListener(CxDocChangedListener listener)
Specified by:
removeInitChangedListener in interface CxDataMgr

fireInitChanged

public void fireInitChanged(com.dat.cx.Node doc)

getInit

public com.dat.cx.Node getInit()
Specified by:
getInit in interface CxDataMgr

setInit

public void setInit(com.dat.cx.Node newInit)
Specified by:
setInit in interface CxDataMgr

setInitNoUndo

public void setInitNoUndo(com.dat.cx.Node node)

getIcon

public java.lang.String getIcon()
Get the icon file name for this port
Overrides:
getIcon in class CxCompositeComponent
Returns:
the file name for the icon

resolveField

public com.d_a_t.expeval.EEField resolveField(java.lang.String identifier)
                                       throws com.d_a_t.expeval.ExpressionException
Augmented to resolve any name which has a port name == field name in the data class as a field.
Overrides:
resolveField in class CxComponent