com.dat.cx
Class CxAttribute

java.lang.Object
  |
  +--com.dat.cx.CxComponent
        |
        +--com.dat.cx.CxAttribute
All Implemented Interfaces:
CxExtendsListener, java.util.EventListener, com.d_a_t.expeval.ExpressionContext, java.beans.PropertyChangeListener

public class CxAttribute
extends CxComponent
implements java.beans.PropertyChangeListener

CxAttribute provides semantics for an XML attribute component.


Fields inherited from class com.dat.cx.CxComponent
compactDisplay, noHatDisplay, standardDisplay
 
Constructor Summary
CxAttribute()
          Default contstuctor
CxAttribute(java.lang.String name, int type, java.lang.String list, int constraint, java.lang.String constraintValue)
          Constructor
 
Method Summary
 XSet export(XSet doc, CxProject project)
          Export the definition of this attribute.
 boolean exportChildren()
           
 int getAttributeConstraint()
          Get the constraint of this attribute
 CxProperty getAttributeConstraintProperty()
          Get the constraint property of this attribute
 int getAttributeType()
          Get the type of this attribute
 CxAttributeType getAttributeTypeProperty()
          Get the type property of this attribute
 java.lang.String getConstraintValue()
          Get the constraint value for fixed and default constraints
 CxProperty getConstraintValueProperty()
           
 com.dat.cx.studio.CxCompDisplay getDisplay()
          Get the display peer for this attribute.
 com.dat.cx.studio.CxInternalFrame getEditFrame(com.dat.cx.studio.CxStudio studio)
          Get at edit frame for editing this component.
 CxProperty getEnumerationProperty()
           
 java.lang.String getIcon()
          Get the icon file name for this component
 java.lang.String getList()
          Get the list for list attributes
 int getXmlType()
          Get the xml type of 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 type from another type.
 boolean isAttribute()
          Determines if the component is an attribute
 boolean isXmlPrimative()
          Determines if the component is of an XML primative type (ie content type String, Integer etc.)
 boolean isXmlString()
          Determines if the component is of an XML String type
 void propertyChange(java.beans.PropertyChangeEvent event)
           
 void setAttributeConstraint(int constraint)
          Set the constraint of the attribute.
 void setAttributeType(int attributeType)
          Set the type of the attribute.
 void setConstraintValue(java.lang.String constraintValue)
          Set the constraint value for fixed and default constraints
 void setList(java.lang.String list)
          Set the list of list attributes.
 
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, exportInfo, findPath, findPath, getBaseType, getChild, getChild, getChildren, getClassClause, getConfig, getConfigValue, getConfigValue, getDataPath, getDataPort, getDisplayStyle, 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, getY, handleException, hasChild, hasChild, hasChildren, hasDisplay, hasProperties, importContent, importInfo, incrUnresolved, init, instantiateChildComponent, instantiateChildComponentAt, isActive, isAttributeInstance, isBaseProperty, isCompositeComponent, isConfiguration, isContentComponent, isDataMgr, 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, makeInfo, omitExport, removeChild, removeChild, removeChildNoUndo, removeComponentChangeListener, removeComponentChildrenListener, removeExtendsListener, renameSortedChild, resolveClass, resolveConstructor, resolveField, 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
 

Constructor Detail

CxAttribute

public CxAttribute()
Default contstuctor

CxAttribute

public CxAttribute(java.lang.String name,
                   int type,
                   java.lang.String list,
                   int constraint,
                   java.lang.String constraintValue)
Constructor
Parameters:
name - the name of the type
type - the content type for the type
Method Detail

isAttribute

public boolean isAttribute()
Determines if the component is an attribute
Overrides:
isAttribute in class CxComponent
Returns:
true if the component is an attribute, otherwise false

isXmlPrimative

public boolean isXmlPrimative()
Determines if the component is of an XML primative type (ie content type String, Integer etc.)
Overrides:
isXmlPrimative in class CxComponent
Returns:
true if the component is of an XML primative type, otherwise false

isXmlString

public boolean isXmlString()
Determines if the component is of an XML String type
Overrides:
isXmlString in class CxComponent
Returns:
true if the component is of an XML primative type, otherwise false

getXmlType

public int getXmlType()
Get the xml type of this component
Overrides:
getXmlType in class CxComponent
Returns:
the xml type, if the component is not of an xml type, returns CxXmlTypes.INVALID

getEditFrame

public com.dat.cx.studio.CxInternalFrame getEditFrame(com.dat.cx.studio.CxStudio studio)
Get at edit frame for editing this component.
Overrides:
getEditFrame in class CxComponent
Returns:
the edit frame

getDisplay

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

importTemplate

public void importTemplate(CxComponent from,
                           boolean copy,
                           boolean inherit,
                           boolean inverse)
Import the definition of a type from another type.
Overrides:
importTemplate in class CxComponent
Parameters:
from - the property 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 - (not used)

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

export

public XSet export(XSet doc,
                   CxProject project)
Export the definition of this attribute.
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()
Description copied from class: CxComponent
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
Following copied from class: com.dat.cx.CxComponent
Returns:
true if the component has an override, otherwise false

exportChildren

public boolean exportChildren()

getAttributeTypeProperty

public CxAttributeType getAttributeTypeProperty()
Get the type property of this attribute
Returns:
the type property of the attribute

getAttributeType

public int getAttributeType()
Get the type of this attribute
Returns:
the current type of the attribute

setAttributeType

public void setAttributeType(int attributeType)
Set the type of the attribute.
Parameters:
type - the new attribute type

getList

public java.lang.String getList()
Get the list for list attributes
Returns:
the list of the attribute

setList

public void setList(java.lang.String list)
Set the list of list attributes.
Parameters:
list - the new list

getEnumerationProperty

public CxProperty getEnumerationProperty()

getAttributeConstraintProperty

public CxProperty getAttributeConstraintProperty()
Get the constraint property of this attribute
Returns:
the constraint property of the attribute

getAttributeConstraint

public int getAttributeConstraint()
Get the constraint of this attribute
Returns:
the current constraint of the attribute

setAttributeConstraint

public void setAttributeConstraint(int constraint)
Set the constraint of the attribute.
Parameters:
type - the new constraint

getConstraintValue

public java.lang.String getConstraintValue()
Get the constraint value for fixed and default constraints
Returns:
the constraint value

setConstraintValue

public void setConstraintValue(java.lang.String constraintValue)
Set the constraint value for fixed and default constraints
Parameters:
constraintValue - the new constraint value

getConstraintValueProperty

public CxProperty getConstraintValueProperty()

getIcon

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

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener