public class Container extends Object
public void setFoo(Foo foo) { getContainer().update(this,this.foo,foo,"foo"); this.foo=foo; } public void setBars(Bar[] bars) { getContainer().update(this,this.bars,bars,"bar"); this.bars=bars; }
Modifier and Type | Class and Description |
---|---|
static interface |
Container.Listener
Listener.
|
static class |
Container.Relationship
A Container event.
|
Constructor and Description |
---|
Container() |
Modifier and Type | Method and Description |
---|---|
void |
addBean(Object obj) |
void |
addEventListener(Container.Listener listener) |
void |
removeBean(Object obj) |
void |
removeEventListener(Container.Listener listener) |
void |
update(Object parent,
Object[] oldChildren,
Object[] children,
String relationship)
Update multiple parent to child relationship.
|
void |
update(Object parent,
Object[] oldChildren,
Object[] children,
String relationship,
boolean addRemove)
Update multiple parent to child relationship.
|
void |
update(Object parent,
Object oldChild,
Object child,
String relationship)
Update single parent to child relationship.
|
void |
update(Object parent,
Object oldChild,
Object child,
String relationship,
boolean addRemove)
Update single parent to child relationship.
|
public void addEventListener(Container.Listener listener)
public void removeEventListener(Container.Listener listener)
public void update(Object parent, Object oldChild, Object child, String relationship)
parent
- The parent of the child.oldChild
- The previous value of the child. If this is non null and differs from child
, then a remove event is generated.child
- The current child. If this is non null and differs from oldChild
, then an add event is generated.relationship
- The name of the relationshippublic void update(Object parent, Object oldChild, Object child, String relationship, boolean addRemove)
parent
- The parent of the child.oldChild
- The previous value of the child. If this is non null and differs from child
, then a remove event is generated.child
- The current child. If this is non null and differs from oldChild
, then an add event is generated.relationship
- The name of the relationshipaddRemove
- If true add/remove is called for the new/old children as well as the relationshipspublic void update(Object parent, Object[] oldChildren, Object[] children, String relationship)
parent
- The parent of the child.oldChildren
- The previous array of children. A remove event is generated for any child in this array but not in the children
array.
This array is modified and children that remain in the new children array are nulled out of the old children array.children
- The current array of children. An add event is generated for any child in this array but not in the oldChildren
array.relationship
- The name of the relationshippublic void update(Object parent, Object[] oldChildren, Object[] children, String relationship, boolean addRemove)
parent
- The parent of the child.oldChildren
- The previous array of children. A remove event is generated for any child in this array but not in the children
array.
This array is modified and children that remain in the new children array are nulled out of the old children array.children
- The current array of children. An add event is generated for any child in this array but not in the oldChildren
array.relationship
- The name of the relationshipaddRemove
- If true add/remove is called for the new/old children as well as the relationshipspublic void addBean(Object obj)
public void removeBean(Object obj)
Copyright © 1995-2015 Mort Bay Consulting. All Rights Reserved.