|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.widget.BaseExpandableListAdapter
com.sibvisions.android.widget.TreeAdapter
public class TreeAdapter
The TreeAdapter is a BaseExpandableListAdapter which gets data from an IDataBook
implementation. It supports ExpandableListView.
The adapter uses the first primary key column to identify the items. Ensure that the primary key column
is set.
The display values will be read from the table columns of the databook. If you didn't specify special
column view resource ids, then the first column of the table columns will be set into the first found view
(Text, Image, Checkbox).
If you specified the column view resource ids, then the columns out of the table columns will be used in the
same order as the column view resource ids were set.
true, false, Y, N or J
| Nested Class Summary | |
|---|---|
static interface |
TreeAdapter.ValueFormatter
The ValueFormatter allows changing the value before it will be set to a view. |
| Constructor Summary | |
|---|---|
TreeAdapter(Context pContext,
IDataBook pDataBookGroup,
IDataBook pDataBookChild,
int pGroupLayout,
int pChildLayout)
Creates a new instance of TreeAdapter. |
|
TreeAdapter(Context pContext,
IDataBook pDataBook,
int pGroupLayout,
int pChildLayout)
Creates a new instance of TreeAdapter. |
|
| Method Summary | |
|---|---|
protected void |
bindView(View pView,
int[] pColumnViewResourceIds,
IDataPage pDataPage,
int pPosition)
Binds an existing view to the data pointed to by databook. |
void |
cancelEditing()
|
protected View |
createChildView(ViewGroup pParent)
Creates a new child view to hold the data pointed to by databook. |
protected View |
createGroupView(ViewGroup pParent)
Creates a new group view to hold the data pointed to by databook. |
IChangeableDataRow |
getChild(int pGroupPosition,
int pChildPosition)
|
int[] |
getChildColumnViewResources()
Gets the resource ids of child views which should be filled with values from the databook. |
long |
getChildId(int pGroupPosition,
int pChildPosition)
|
int |
getChildrenCount(int pGroupPosition)
|
View |
getChildView(int pGroupPosition,
int pChildPosition,
boolean pIsLastChild,
View pConvertView,
ViewGroup pParent)
|
protected Context |
getContext()
Gets the applications global information. |
IChangeableDataRow |
getGroup(int pGroupPosition)
|
int[] |
getGroupColumnViewResources()
Gets the resource ids of group views which should be filled with values from the databook. |
int |
getGroupCount()
|
long |
getGroupId(int pGroupPosition)
|
View |
getGroupView(int pGroupPosition,
boolean isExpanded,
View pConvertView,
ViewGroup pParent)
|
TranslationMap |
getTranslation()
|
TreeAdapter.ValueFormatter |
getValueFormatter()
Gets the current value formatter. |
boolean |
hasStableIds()
|
boolean |
isChildSelectable(int pGroupPosition,
int pChildPosition)
|
void |
notifyRepaint()
|
void |
saveEditing()
|
void |
setChildColumnViewResources(int[] pViewResourceIds)
Sets the resource ids of child views which should be filled with values from the databook. |
void |
setGroupColumnViewResources(int[] pViewResourceIds)
Sets the resource ids of group views which should be filled with values from the databook. |
void |
setTranslation(TranslationMap pTranslation)
|
void |
setValueFormatter(TreeAdapter.ValueFormatter pFormatter)
Sets the formatter to change values before they will be set to a view. |
| Methods inherited from class android.widget.BaseExpandableListAdapter |
|---|
areAllItemsEnabled, getCombinedChildId, getCombinedGroupId, isEmpty, notifyDataSetChanged, notifyDataSetInvalidated, onGroupCollapsed, onGroupExpanded, registerDataSetObserver, unregisterDataSetObserver |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TreeAdapter(Context pContext,
IDataBook pDataBook,
int pGroupLayout,
int pChildLayout)
TreeAdapter.
pContext - interface to application's global informationpDataBook - a self joined databookpGroupLayout - the group layoutpChildLayout - the child layout
public TreeAdapter(Context pContext,
IDataBook pDataBookGroup,
IDataBook pDataBookChild,
int pGroupLayout,
int pChildLayout)
TreeAdapter.
pContext - interface to application's global informationpDataBookGroup - a databook for group datapDataBookChild - a databook for child datapGroupLayout - the group layoutpChildLayout - the child layout| Method Detail |
|---|
public void notifyRepaint()
notifyRepaint in interface IControlpublic void saveEditing()
saveEditing in interface IControlpublic void cancelEditing()
cancelEditing in interface IControlpublic void setTranslation(TranslationMap pTranslation)
setTranslation in interface IControlpublic TranslationMap getTranslation()
getTranslation in interface IControlpublic int getGroupCount()
getGroupCount in interface ExpandableListAdapterpublic IChangeableDataRow getGroup(int pGroupPosition)
getGroup in interface ExpandableListAdapterpublic long getGroupId(int pGroupPosition)
getGroupId in interface ExpandableListAdapter
public View getGroupView(int pGroupPosition,
boolean isExpanded,
View pConvertView,
ViewGroup pParent)
getGroupView in interface ExpandableListAdapterpublic int getChildrenCount(int pGroupPosition)
getChildrenCount in interface ExpandableListAdapter
public IChangeableDataRow getChild(int pGroupPosition,
int pChildPosition)
getChild in interface ExpandableListAdapter
public long getChildId(int pGroupPosition,
int pChildPosition)
getChildId in interface ExpandableListAdapter
public View getChildView(int pGroupPosition,
int pChildPosition,
boolean pIsLastChild,
View pConvertView,
ViewGroup pParent)
getChildView in interface ExpandableListAdapterpublic boolean hasStableIds()
hasStableIds in interface ExpandableListAdapter
public boolean isChildSelectable(int pGroupPosition,
int pChildPosition)
isChildSelectable in interface ExpandableListAdapterprotected Context getContext()
public void setGroupColumnViewResources(int[] pViewResourceIds)
pViewResourceIds - the resource ids within a layoutpublic int[] getGroupColumnViewResources()
public void setChildColumnViewResources(int[] pViewResourceIds)
pViewResourceIds - the resource ids within a layoutpublic int[] getChildColumnViewResources()
protected View createGroupView(ViewGroup pParent)
pParent - the parent to which the new view is attached to
protected View createChildView(ViewGroup pParent)
pParent - the parent to which the new view is attached to
protected void bindView(View pView,
int[] pColumnViewResourceIds,
IDataPage pDataPage,
int pPosition)
pView - existing view, returned earlier by createViewpColumnViewResourceIds - a list of resource ids for specific binding of valuespDataPage - the data pagepPosition - the row position in the data pagepublic void setValueFormatter(TreeAdapter.ValueFormatter pFormatter)
pFormatter - the formatter or null to unsetpublic TreeAdapter.ValueFormatter getValueFormatter()
null if no formatter will be used
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||