T - The domain class type represented by this nodepublic abstract class AbstractNode<T> extends Object implements ObjectSelectionNode
| Modifier and Type | Field and Description |
|---|---|
protected DomainObjectProxy |
objectProxy
The object proxy representing the domain object
|
CLEAN, CLEARED, DIRTY, EDITED| Constructor and Description |
|---|
AbstractNode() |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor<ObjectSelectionNode> visitor) |
protected void |
addToAssociation(String roleName,
Object domainObject,
Set association)
Internal use
|
abstract void |
append(T domainInstance,
String field)
Appends the value from the specified field (if possible) to the
corresponding text area.
|
protected void |
appendOnEDT(T domainInstance,
String field)
INTERNAL USE.
|
boolean |
checkChanged()
If the dialog controllers ignoreCheckChange is
false this
method checks if the node (with children) is unchanged. |
boolean |
checkChangedAsChild()
Recursivly calls check change and then checks the integrity of the
relation of this target and the parent target if the target is
up-related.
|
boolean |
checkClear()
If the controller's ignoreCheckChange property is
false,
determin if it is ok to proceed with action clear. |
boolean |
checkClose()
If the dialog controllers Determin if it is ok to proceed with action
close window.
|
boolean |
checkDelete()
If the controller's ignoreCheckChange property is
false,
determin if it is ok to proceed with action delete. |
boolean |
checkFind()
If the controller's ignoreCheckChange property is
false,
determin if it is ok to proceed with find action. |
boolean |
checkPrint() |
boolean |
checkRowSelection(int oldSelection,
int newSelection)
If the controller's ignoreCheckChange property is
false,
determine if it is ok to proceed to change the selected row in a
listblock. |
boolean |
checkRowSelection(int oldSelection,
int newSelection,
Set foreignNodes) |
boolean |
checkSave()
If the controller's ignoreCheckChange property is
false,
determin if it is ok to proceed with action save. |
protected void |
clearAllAssociation()
Clears all associations for the role.
|
protected void |
clearKeepKeysOnEDT()
INTERNAL USE.
|
protected void |
clearOnEDT()
INTERNAL USE.
|
protected void |
clearOnEDT(String s)
INTERNAL USE.
|
abstract void |
display(String attributeName,
Object value)
Displays the specified attribute value.
|
abstract void |
display(String attributeName,
Object value,
boolean resetState)
Updates data of given attriubte in object selection in the dialog.
|
abstract void |
display(T domainInstance,
String attributeName,
boolean resetState)
Updates data of given attriubte in object selection in the dialog.
|
abstract void |
displayAboveTarget(Collection resultObject,
List pathToTarget,
boolean findAll)
Displays the collection of domain objects.
|
void |
displayOnEDT(Collection resultObject,
List pathToTarget,
boolean findAll)
Performs a recursive display.
|
protected void |
displayOnEDT(Object domainInstance)
INTERNAL USE.
|
protected void |
displayOnEDT(String attributeName,
Object value,
boolean resetState)
INTERNAL USE.
|
protected void |
displayOnEDT(T domainInstance,
String attributeName,
boolean resetState)
INTERNAL USE.
|
Set |
getAllChildNames()
Returns a Set of Strings containing the names of all children
(recursively).
|
protected Object |
getAssociation(String roleName,
Object domainObject)
Internal use.
|
Set |
getChangedNoKeyFields()
Returns a set containing all fields that have changed since the initial
display and wich are not part of the key, in other words the complement
of the set derived by getChangedKeyFields
|
abstract Object |
getEmptyDomainObject()
Returns an empty instance of the domain object represented by this object
selection target.
|
List<AbstractNode> |
getPathToNode()
Returns the path from the root node to this node.
|
DomainObjectProxy |
getProxy()
Retuns the domain object proxy for this target.
|
Map |
getRoleNameToAssociationMap()
Experimental.
|
ObjectSelectionNode |
getRootNode()
Returns the root node of this object selection node.
|
int |
getState()
Returns the current state of this node.
|
Object |
greedyObtain()
Internal use.
|
boolean |
inListblock()
Returns
true if this role is a listblock role. |
boolean |
isChanged(String attributeName)
Check if the specified attribute is changed.
|
abstract boolean |
isNavigableToParent()
Internal use.
|
boolean |
isRootNode()
Check if this is a root node and if so, return
true |
abstract void |
mergeAssociations(Object domainObject,
List pathToTarget,
boolean error)
Internal use.
|
void |
nullProxy()
Recursivly releases the proxy on this target.
|
Set |
obtainSet()
Deprecated.
|
Set |
obtainSet(boolean createIfNull)
Obtains a set of domain objects.
|
Object |
peekAtObject()
Returns a shallow copy of the domain object, where attributes are read
from the dialog.
|
void |
recursiveDisplay(Collection domainObjectCollection)
Displays the Set of domain objects.
|
void |
removeFromParent(Object root)
Internal use.
|
void |
resetAssociations(Object o)
Internal use.
|
protected void |
saveAssociation(String roleName,
Object domainObject,
Object association)
Internal use.
|
protected abstract void |
setAssociation(Object self,
String associationRoleName,
Object association)
Internal use.
|
protected void |
setEnabledOnEDT(boolean enable)
INTERNAL USE.
|
protected void |
setEnabledOnEDT(boolean enable,
String field)
INTERNAL USE.
|
protected void |
setFocusOnEDT(String field)
INTERNAL USE.
|
protected void |
setShownOnEDT(boolean shown)
INTERNAL USE.
|
protected void |
setShownOnEDT(boolean shown,
String field)
INTERNAL USE.
|
int |
setState(int state)
Sets the current state of this node.
|
protected int |
setState(int state,
boolean override)
Sets the state of this target.
|
protected void |
setStyleOnEDT(Color foreground,
Color background)
INTERNAL USE.
|
void |
visitBranch(Visitor<ObjectSelectionNode> visitor)
Visit all nodes in this branch
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChild, callCheckChangeHook, callCheckClearHook, callCheckCloseHook, callCheckDeleteHook, callCheckFindHook, callCheckRowSelectHook, callCheckSaveHook, callHookBeforeDisplay, clear, clear, clearKeepKeys, display, getChangedFields, getChangedKeyFields, getChildren, getController, getParentNode, getRepresentingClass, getRoleName, hasFocus, hasOneValue, hasValue, hasValue, isConsistant, isEnabled, isEnabled, isShown, isShown, obtain, obtainAsObject, osDisplay, recursiveObtainObject, recursiveObtainObject, resetFields, setChanged, setChanged, setEnabled, setEnabled, setFocus, setParentNode, setShown, setShown, setShowZero, setStyleprotected DomainObjectProxy objectProxy
public Set getChangedNoKeyFields()
ObjectSelectionNodegetChangedNoKeyFields in interface ObjectSelectionNodepublic int setState(int state)
ObjectSelectionNodeObjectSelectionNode.getState().setState in interface ObjectSelectionNodestate - the new state to set.protected void clearOnEDT()
protected void clearKeepKeysOnEDT()
ObjectSelectionNode.clearKeepKeys()protected void clearOnEDT(String s)
s - the field to clearpublic abstract void append(T domainInstance, String field)
domainInstance - the domain instance with the field value to appendfield - the fieldprotected void appendOnEDT(T domainInstance, String field)
domainInstance - the domain instancefield - the fieldappend(Object, String)protected int setState(int state,
boolean override)
true the state is overridden, and the state is not
calculated when invoking getState().state - the state to set.override - if true the state is overriddenpublic int getState()
ObjectSelectionNodegetState in interface ObjectSelectionNodepublic void recursiveDisplay(Collection domainObjectCollection)
domainObjectCollection - the collection of objects to displayprotected void displayOnEDT(Object domainInstance)
domainInstance - the domain instance to displayprotected void displayOnEDT(String attributeName, Object value, boolean resetState)
attributeName - the name of the attribute to displayvalue - the value of the attribute to displayresetState - flag - if true state is resetpublic abstract void display(String attributeName, Object value, boolean resetState)
attributeName - Name of attribute to update.value - The new value.resetState - Set to false to avoid resetting the attribute state.public void displayOnEDT(Collection resultObject, List pathToTarget, boolean findAll)
ObjectSelectionNodedisplayOnEDT in interface ObjectSelectionNoderesultObject - a collection of domain objectspathToTarget - the path to the target nodefindAll - true if the display is a result of a find all
action.public abstract void displayAboveTarget(Collection resultObject, List pathToTarget, boolean findAll)
ObjectSelectionNodedisplayAboveTarget in interface ObjectSelectionNoderesultObject - the domain objects to displaypathToTarget - the path to the target nodefindAll - if true the display is invoked as part of a
find all action.@Deprecated public Set obtainSet()
obtainSet(boolean)public abstract void display(T domainInstance, String attributeName, boolean resetState)
domainInstance - Attributes are copied from this object.attributeName - The attribute to set.resetState - Set to false to avoid resetting the attribute state.protected void displayOnEDT(T domainInstance, String attributeName, boolean resetState)
domainInstance - (missing javadoc)attributeName - (missing javadoc)resetState - (missing javadoc)display(Object, String, boolean)protected void setFocusOnEDT(String field)
field - (missing javadoc)ObjectSelectionNode.setFocus(String)protected void setShownOnEDT(boolean shown)
shown - (missing javadoc)ObjectSelectionNode.setShown(boolean)protected void setShownOnEDT(boolean shown,
String field)
shown - (missing javadoc)field - (missing javadoc)ObjectSelectionNode.setShown(boolean, String)protected void setEnabledOnEDT(boolean enable,
String field)
enable - (missing javadoc)field - (missing javadoc)ObjectSelectionNode.setEnabled(boolean, String)protected void setEnabledOnEDT(boolean enable)
enable - (missing javadoc)ObjectSelectionNode.setEnabled(boolean)protected void setStyleOnEDT(Color foreground, Color background)
foreground - (missing javadoc)background - (missing javadoc)ObjectSelectionNode.setStyle(Color, Color)public Set obtainSet(boolean createIfNull)
createIfNull flag is true: If a listblock
line holds a null-reference to a domain instance, a new object will be
created by the listblock line.obtainSet in interface ObjectSelectionNodecreateIfNull - flag indicating if missing objects should be created.ListblockLine.getObject(String, boolean)public void nullProxy()
public boolean checkFind()
ObjectSelectionNodefalse,
determin if it is ok to proceed with find action. The following
conditions are checked:
true.
Otherwise, a modal dialog is shown and the user (of the application) is
asked wether to proceed or not. If the user answers yes, the returned
value is true.checkFind in interface ObjectSelectionNodetrue if it's ok to proceed with find.G9DialogController.setIgnoreCheckChanged(boolean)public boolean checkRowSelection(int oldSelection,
int newSelection)
ObjectSelectionNodefalse,
determine if it is ok to proceed to change the selected row in a
listblock.checkRowSelection in interface ObjectSelectionNodeoldSelection - the index of the old selectionnewSelection - the index of the new selectionG9DialogController.setIgnoreCheckChanged(boolean)public boolean checkRowSelection(int oldSelection,
int newSelection,
Set foreignNodes)
oldSelection - (missing javadoc)newSelection - (missing javadoc)foreignNodes - (missing javadoc)public boolean checkPrint()
public boolean checkClose()
ObjectSelectionNodetrue. Otherwise, a modal
dialog is shown and the user (of the application) is asked wether to
proceed or not. If the user answers "yes", the return value is true
.checkClose in interface ObjectSelectionNodetrue if it's ok to proceed with close.G9DialogController.setIgnoreCheckChanged(boolean)public boolean checkDelete()
ObjectSelectionNodefalse,
determin if it is ok to proceed with action delete. If he dialog does not
contain any changed data since it's last display, the return value is
true. Otherwise, a modal dialog is shown and the user (of
the application) is asked wether to proceed or not. If the user answers
"yes", the return value is true.checkDelete in interface ObjectSelectionNodetrue if it's ok to proceed with delte.G9DialogController.setIgnoreCheckChanged(boolean)public boolean checkClear()
ObjectSelectionNodefalse,
determin if it is ok to proceed with action clear. If the dialog does not
contain any changed data since it's last display, the return value is
true. Otherwise, a model dialog is shown and the user (of
the application) is asked wether to proceed or not. If the user answers
"yes", the return value is true.checkClear in interface ObjectSelectionNodetrue if it's ok to proceed with delete. *G9DialogController.setIgnoreCheckChanged(boolean)public boolean checkSave()
ObjectSelectionNodefalse,
determin if it is ok to proceed with action save. No specific check is
perfomed, but a hook is called for each node involved in the save action
(the sequence is from the top of the object selection). The returned
value from this method is always true, and the return value
from the specific hook methods are used to determin wether to proceed
with the check save or not.checkSave in interface ObjectSelectionNodetrue if it is ok to proceed with action save.G9DialogController.setIgnoreCheckChanged(boolean)public boolean checkChanged()
ObjectSelectionNodefalse this
method checks if the node (with children) is unchanged. To things are
considered:
This is done recursivly, thus the first node checked is a leaf-node.
false
checkChanged in interface ObjectSelectionNodetrue if no fields are changed and all up-related
relations are intact.G9DialogController.setIgnoreCheckChanged(boolean)public boolean checkChangedAsChild()
true if fields and relations are intact.public abstract Object getEmptyDomainObject()
public Object peekAtObject()
peekAtObject in interface ObjectSelectionNodepublic DomainObjectProxy getProxy()
public abstract void display(String attributeName, Object value)
markIfChanged parameter is
true.attributeName - the name of the attributevalue - the value to displaypublic List<AbstractNode> getPathToNode()
ObjectSelectionNodegetPathToNode in interface ObjectSelectionNodepublic ObjectSelectionNode getRootNode()
ObjectSelectionNodegetRootNode in interface ObjectSelectionNodepublic boolean isRootNode()
truetrue if this is a root nodepublic Set getAllChildNames()
public abstract void mergeAssociations(Object domainObject, List pathToTarget, boolean error)
Merge the associations from the specified domain object with the stored associations. This is done after return from a server action.
Before the object tree is sent to the server, all objects not on path to target (and not up-related) are stripped away and stored in order to reduce network traffic. This method restores the associations, merging the result from the server with the stored associations.
domainObject - the domain objectpathToTarget - the path to the target target.error - true if rhe merge is after an error situationprotected void saveAssociation(String roleName, Object domainObject, Object association)
Saves the association
roleName - the role name of the domain object's associationdomainObject - the domain objectassociation - the associationmergeAssociations(Object, List, boolean)protected Object getAssociation(String roleName, Object domainObject)
Gets the stored association with the specified role name belonging to the specified domain object.
roleName - the role name of the associationdomainObject - the domain object the association belongs topublic void removeFromParent(Object root)
root - the root instance.public Map getRoleNameToAssociationMap()
protected void clearAllAssociation()
protected void addToAssociation(String roleName, Object domainObject, Set association)
Adds the specified association to the stored associations
roleName - the role name of the associationdomainObject - the domain object with the associationassociation - the associationpublic void resetAssociations(Object o)
o - the domain object for which to restore associations.public boolean isChanged(String attributeName) throws G9ClientException
ObjectSelectionNodeisChanged in interface ObjectSelectionNodeattributeName - the name of the attributetrue if the field has changed, otherwise false
.G9ClientException - if the attribute is not part of this role.getChangedNoKeyFields(),
ObjectSelectionNode.getChangedKeyFields(),
ObjectSelectionNode.getChangedFields()public boolean inListblock()
true if this role is a listblock role.inListblock in interface ObjectSelectionNodetrue if this is a listblock role.protected abstract void setAssociation(Object self, String associationRoleName, Object association)
self to the
association with the role assocationRoleName.self - the object to set the association fromassociationRoleName - the association nameassociation - the association instance.public abstract boolean isNavigableToParent()
true if role is navigable to parent.public Object greedyObtain()
greedyObtain in interface ObjectSelectionNodepublic void accept(Visitor<ObjectSelectionNode> visitor)
accept in interface Visitable<ObjectSelectionNode>public void visitBranch(Visitor<ObjectSelectionNode> visitor)
ObjectSelectionNodevisitBranch in interface ObjectSelectionNodevisitor - the visitor that gets the visit callback.Copyright © 2006–2020 Esito AS. All rights reserved.