|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.esper.view.ViewSupport
public abstract class ViewSupport
A helper class for View implementations that provides generic implementation for some of the methods. Methods that contain the actual logic of the view are not implemented in this class. A common implementation normally does not need to override any of the methods implemented here, their implementation is generic and should suffice. The class provides a convenience method for updateing it's children data updateChildren(Object[], Object[]). This method should be called from within the View.update(Object[], Object[]) methods in the subclasses.
Field Summary | |
---|---|
protected Viewable |
parent
Parent viewable to this view - directly accessible by subclasses. |
Constructor Summary | |
---|---|
protected |
ViewSupport()
Constructor. |
Method Summary | |
---|---|
View |
addView(View view)
Add a view to the viewable object. |
static void |
dumpChildViews(String prefix,
Viewable parentViewable)
Convenience method for logging the child views of a Viewable. |
static void |
dumpUpdateParams(String prefix,
Object[] newData,
Object[] oldData)
Convenience method for logging the parameters passed to the update method. |
static List<View> |
findDescendent(Viewable parentView,
Viewable descendentView)
Find the descendent view in the view tree under the parent view returning the list of view nodes between the parent view and the descendent view. |
Viewable |
getParent()
Returns the View's parent Viewable. |
List<View> |
getViews()
Returns all added views. |
boolean |
hasViews()
Test is there are any views to the Viewable. |
boolean |
removeView(View view)
Remove a view. |
void |
setParent(Viewable parent)
Called when the View is added to a Viewable object. |
void |
updateChildren(EventBean[] newData,
EventBean[] oldData)
Updates all the children with new data. |
protected static void |
updateChildren(List<View> childViews,
EventBean[] newData,
EventBean[] oldData)
Updates all the children with new data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.esper.view.View |
---|
update |
Field Detail |
---|
protected Viewable parent
Constructor Detail |
---|
protected ViewSupport()
Method Detail |
---|
public final Viewable getParent()
View
getParent
in interface View
public void setParent(Viewable parent)
View
setParent
in interface View
parent
- is the parent that this view is a child ofpublic final View addView(View view)
Viewable
addView
in interface Viewable
view
- to add
public final boolean removeView(View view)
Viewable
removeView
in interface Viewable
view
- to remove
public final List<View> getViews()
Viewable
getViews
in interface Viewable
public final boolean hasViews()
Viewable
hasViews
in interface Viewable
public final void updateChildren(EventBean[] newData, EventBean[] oldData)
newData
- is the array of new event dataoldData
- is the array of old event dataprotected static void updateChildren(List<View> childViews, EventBean[] newData, EventBean[] oldData)
childViews
- is the list of child views to send the data tonewData
- is the array of new event dataoldData
- is the array of old event datapublic static void dumpUpdateParams(String prefix, Object[] newData, Object[] oldData)
prefix
- is a prefix text to output for each linenewData
- is the new data in an update calloldData
- is the old data in an update callpublic static void dumpChildViews(String prefix, Viewable parentViewable)
prefix
- is a text to print for each view printedparentViewable
- is the parent for which the child views are displayed.public static List<View> findDescendent(Viewable parentView, Viewable descendentView)
parentView
- is the view to start searching underdescendentView
- is the view to find
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |