public abstract class ViewSupport extends Object implements View
Modifier and Type | Field and Description |
---|---|
static View[] |
EMPTY_VIEW_ARRAY |
protected Viewable |
parent
Parent viewable to this view - directly accessible by subclasses.
|
Modifier | Constructor and Description |
---|---|
protected |
ViewSupport()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
View |
addView(View view)
Add a view to the viewable object.
|
static View[] |
addView(View[] children,
View view) |
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 void |
dumpUpdateParams(String prefix,
UniformPair<EventBean[]> result)
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.
|
static int |
findViewIndex(View[] children,
View view) |
Viewable |
getParent()
Returns the View's parent Viewable.
|
View[] |
getViews()
Returns all added views.
|
boolean |
hasViews()
Test is there are any views to the Viewable.
|
void |
removeAllViews()
Remove all views.
|
boolean |
removeView(View view)
Remove a view.
|
static View[] |
removeView(View[] children,
int index) |
void |
setParent(Viewable parent)
Called when the View is added to a Viewable object.
|
protected static void |
updateChildren(Collection<View> childViews,
EventBean[] newData,
EventBean[] oldData)
Updates all the children with new data.
|
void |
updateChildren(EventBean[] newData,
EventBean[] oldData)
Updates all the children with new data.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEventType, iterator
forEach, spliterator
public static final View[] EMPTY_VIEW_ARRAY
protected Viewable parent
public Viewable getParent()
View
public void setParent(Viewable parent)
View
public View addView(View view)
Viewable
public boolean removeView(View view)
Viewable
removeView
in interface Viewable
view
- to removepublic void removeAllViews()
Viewable
removeAllViews
in interface Viewable
public View[] getViews()
Viewable
public boolean hasViews()
Viewable
public void updateChildren(EventBean[] newData, EventBean[] oldData)
newData
- is the array of new event dataoldData
- is the array of old event dataprotected static void updateChildren(Collection<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, UniformPair<EventBean[]> result)
prefix
- is a prefix text to output for each lineresult
- is the data in an update callpublic 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