|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object project35.mda.model.RecordNameProvider project35.mda.model.RecordModel
public class RecordModel
The main model data structure Project35 uses to describe model record types.
Copyright (c) Kevin Garwood and University of Manchester 2007. All rights reserved. Licensed under the Academic Free License version 3.0. For more information on the terms and conditions, please see the file "LICENSE" that is included in this distribution.
Field Summary |
---|
Fields inherited from class project35.mda.model.RecordNameProvider |
---|
containingListModel, instanceIdentifier, isVisible, toolTipText, useInstanceIdentifier |
Constructor Summary | |
---|---|
RecordModel()
|
Method Summary | |
---|---|
void |
addChild(java.lang.String selectionFieldName,
RecordNameProvider child,
boolean enableSave)
assumes selection field name will be valid and represent a list field |
void |
addField(DataFieldModel field)
adds a field to the model |
void |
addReference(RecordModelReference reference)
|
java.lang.Object |
clone()
only reports errors in the edit fields |
java.lang.String |
computeDisplayName()
|
java.lang.String |
computeDisplayName(boolean useTruncation)
|
void |
enableSaveChanges(boolean flag)
sets whether the record can save changes. |
java.util.ArrayList |
getAttributeFields()
gets a list of those edit fields that represent XML attributes |
java.lang.String |
getDisplayName()
|
java.lang.String[] |
getEditFieldNames()
provides the list of edit field names. |
java.util.ArrayList |
getEditFields()
provides a list of edit fields |
java.util.ArrayList |
getElementFields()
|
DataFieldModel |
getField(java.lang.String fieldName)
returns the data field model associated with the given field name |
java.util.ArrayList |
getFields()
|
java.net.URL |
getHelpLink()
returns the context sensitive help associated with this record |
java.lang.Integer |
getIdentifier()
|
IDFieldModel |
getIDField()
|
java.util.ArrayList |
getListFields()
|
ListFieldModel |
getListModelForChildType(java.lang.String childType)
Project35's project35.io.XMLFileReader uses this method to reconstitute a record tree based on an XML file. |
java.lang.String[] |
getMissingRecordTypes()
this is a convenience method for helping to determine which of its required list fields remains empty. |
java.lang.String |
getNameSpacePrefix()
Get the value of nameSpacePrefix. |
java.util.ArrayList |
getProxyListFields()
|
java.lang.String |
getRecordClassName()
Get the value of recordClassName. |
java.util.ArrayList |
getReferences()
|
java.lang.String |
getValue(java.lang.String fieldName)
|
void |
informListenersOfGainedFocus()
method used to inform listeners that the record has gained focus this method is invoked when edit button in list field is pressed. |
void |
informListenersOfNameChange()
informs change listeners if the display name has changed. |
boolean |
isAmbiguous()
Returns whether this RecordModel is ambiguous or not. |
boolean |
isEditField(java.lang.String fieldName)
convenience method for determining whether the field is an edit field or not. |
boolean |
isListField(java.lang.String fieldName)
convenience method for determining whether the field is a list field or not. |
boolean |
isNewRecord()
|
boolean |
isRequiredField(java.lang.String fieldName)
|
void |
removeAllChildren(java.lang.String fieldName)
|
DataFieldModel |
removeField(DataFieldModel field)
Removes a field from the model |
void |
removeFields(java.util.ArrayList fieldsToRemove)
Removes a field from the model |
void |
removeReference(RecordModelReference reference)
|
void |
replaceField(DataFieldModel oldFieldModel,
DataFieldModel newFieldModel)
|
void |
resolveReferences()
|
boolean |
saveChanges()
determines whether the model needs to have changes saved |
void |
setDisplayName(java.lang.String displayName)
sets the display name of the record |
void |
setFields(java.util.ArrayList fields)
sets the data fields for this record |
void |
setHelpLink(java.net.URL helpLink)
sets URL for context sensitive help |
void |
setIdentifier(java.lang.Integer identifier)
|
void |
setNameSpacePrefix(java.lang.String nameSpacePrefix)
Set the value of nameSpacePrefix. |
void |
setNewRecord(boolean isNewRecord)
sets whether a record is designated as new or already existing. |
void |
setRecordClassName(java.lang.String recordClassName)
Set the value of recordClassName. |
void |
setSaveChanges(boolean saveChanges)
determines if changes need to be saved This method really means: "Something has changed in the record and it has been committed." Because a change has been committed, the method sets "isNewRecord" to false. |
void |
setValue(java.lang.String fieldName,
java.lang.String value,
boolean enableSaveChanges)
assumes we are guaranteed that the field name will be legal and that the fieldname will refer to some edit field. |
java.lang.String |
toString()
|
void |
updateDisplayName()
updates the display name of therecord |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RecordModel()
Method Detail |
---|
public java.lang.Integer getIdentifier()
public java.lang.String getDisplayName()
getDisplayName
in class RecordNameProvider
public IDFieldModel getIDField()
public java.util.ArrayList getFields()
public DataFieldModel getField(java.lang.String fieldName)
fieldName
- the name of the data field
public boolean isRequiredField(java.lang.String fieldName)
fieldName
- the name of a field
public boolean isListField(java.lang.String fieldName)
fieldName
- the name of the data field
public boolean isEditField(java.lang.String fieldName)
fieldName
- the field name
public java.lang.String getRecordClassName()
getRecordClassName
in class RecordNameProvider
public java.util.ArrayList getListFields()
public java.util.ArrayList getProxyListFields()
public java.lang.String[] getEditFieldNames()
public java.util.ArrayList getEditFields()
public java.util.ArrayList getAttributeFields()
public java.util.ArrayList getElementFields()
public java.lang.String[] getMissingRecordTypes()
public java.lang.String computeDisplayName()
computeDisplayName
in class RecordNameProvider
public java.lang.String computeDisplayName(boolean useTruncation)
public java.net.URL getHelpLink()
public boolean isNewRecord()
public boolean isAmbiguous()
<xs:element name="test"> <xs:complexType> <xs:sequence> <xs:element name="test1" type="xs:float" minOccurs="0"/> <xs:element name="test1" type="xs:float" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element>
public java.lang.String getNameSpacePrefix()
public void removeReference(RecordModelReference reference)
public void addReference(RecordModelReference reference)
public java.util.ArrayList getReferences()
public boolean saveChanges()
public void replaceField(DataFieldModel oldFieldModel, DataFieldModel newFieldModel)
public void addField(DataFieldModel field)
field
- to add to the record.public void removeFields(java.util.ArrayList fieldsToRemove)
field
- Field to be removed.public DataFieldModel removeField(DataFieldModel field)
field
- Field to be removed.
public java.lang.String getValue(java.lang.String fieldName)
public void setValue(java.lang.String fieldName, java.lang.String value, boolean enableSaveChanges)
fieldName
- name of the field. Assumes the field name is
appropriate for the modelvalue
- the value for the edit field.public ListFieldModel getListModelForChildType(java.lang.String childType)
childType
- the type of subrecord that might belong to
one of the record's list fields.
public void addChild(java.lang.String selectionFieldName, RecordNameProvider child, boolean enableSave)
public void removeAllChildren(java.lang.String fieldName)
public void setRecordClassName(java.lang.String recordClassName)
recordClassName
- Value to assign to recordClassName.public void setFields(java.util.ArrayList fields)
fields
- the list of fieldspublic void setSaveChanges(boolean saveChanges)
saveChanges
- true if changes should be saved; otherwise falsepublic void informListenersOfNameChange()
public void informListenersOfGainedFocus()
informListenersOfGainedFocus
in class RecordNameProvider
public void setNewRecord(boolean isNewRecord)
isNewRecord
- true if the record is new; otherwise the record
already existspublic void setDisplayName(java.lang.String displayName)
displayName
- the new display name for the recordpublic void updateDisplayName()
updateDisplayName
in class RecordNameProvider
public void enableSaveChanges(boolean flag)
flag
- true if record should be allowed to save changes
otherwise false.public void setHelpLink(java.net.URL helpLink)
helpLink
- the URL that describes help for this record modelpublic void resolveReferences()
public void setIdentifier(java.lang.Integer identifier)
public void setNameSpacePrefix(java.lang.String nameSpacePrefix)
nameSpacePrefix
- Value to assign to nameSpacePrefix.public java.lang.Object clone()
clone
in class RecordNameProvider
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |