public abstract class SectionLifecycle extends Object implements EventDispatcher, EventTriggerTarget
Constructor and Description |
---|
SectionLifecycle() |
Modifier and Type | Method and Description |
---|---|
Object |
acceptTriggerEvent(EventTrigger eventTrigger,
Object eventState,
Object[] params) |
protected void |
bindService(SectionContext c) |
protected Children |
createChildren(SectionContext c)
This methods will delegate to the
GroupSectionSpec method annotated with OnCreateChildren |
protected void |
createInitialState(SectionContext c) |
protected void |
createService(SectionContext c) |
protected void |
dataBound(SectionContext c)
This method will delegate to the
Section Spec method annotated with OnDataBound |
protected void |
dataRendered(SectionContext c,
boolean isDataChanged,
boolean isMounted,
long uptimeMillis,
int firstVisibleIndex,
int lastVisibleIndex,
ChangesInfo changesInfo,
int globalOffset)
This method will delegate to the
Section Spec method annotated with OnDataRendered . |
static void |
dispatchLoadingEvent(SectionContext context,
boolean isEmpty,
LoadingEvent.LoadingState loadingState,
Throwable t) |
Object |
dispatchOnEvent(EventHandler eventHandler,
Object eventState) |
protected void |
generateChangeSet(SectionContext c,
ChangeSet changeSet,
Section previous,
Section next)
This method will delegate to the
DiffSectionSpec method annotated with OnDiff |
protected static EventTrigger |
getEventTrigger(SectionContext c,
int id,
Handle handle) |
protected static EventTrigger |
getEventTrigger(SectionContext c,
int id,
String key) |
static EventHandler |
getLoadingEventHandler(SectionContext context) |
protected Object |
getService(Section section) |
protected TreeProps |
getTreePropsForChildren(SectionContext c,
TreeProps previousTreeProps)
Updates the TreeProps map with outputs from all
OnCreateTreeProp methods. |
boolean |
isDiffSectionSpec() |
static boolean |
isSectionIndexValid(SectionContext c,
String keyString,
int index)
Check to see if an index provided for within a section is valid
|
protected static <E> EventHandler<E> |
newEventHandler(Class<? extends Section> reference,
SectionContext c,
int id,
Object[] params) |
protected static <E> EventHandler<E> |
newEventHandler(Section c,
int id,
Object[] params) |
protected static <E> EventTrigger<E> |
newEventTrigger(SectionContext c,
String childKey,
int id,
Handle handle) |
protected void |
populateTreeProps(TreeProps parentTreeProps)
Retrieves all of the tree props used by this Section from the TreeProps map and sets the tree
props as fields on the ComponentImpl.
|
protected void |
refresh(SectionContext sectionContext) |
static void |
requestFocus(SectionContext c,
int index)
Scroll to the index of the section.
|
static void |
requestFocus(SectionContext c,
String sectionKey)
Scroll to the beginning of the section with the given key.
|
static void |
requestFocus(SectionContext c,
String sectionKey,
FocusType focusType)
Scroll to the index in the section with the given key.
|
static void |
requestFocusWithOffset(SectionContext c,
int index,
int offset)
Scroll to the index in the section with an additional offset.
|
static void |
requestFocusWithOffset(SectionContext c,
String sectionKey,
int offset)
Scroll to the beginning of the section with the given key and an additional offset.
|
static void |
requestFocusWithOffset(SectionContext c,
String sectionKey,
int index,
int offset)
Scroll to the index in the section with the given key and an additional offset.
|
static void |
requestSmoothFocus(SectionContext c,
int index) |
static void |
requestSmoothFocus(SectionContext c,
int index,
SmoothScrollAlignmentType type) |
static void |
requestSmoothFocus(SectionContext c,
String keyString,
int index,
int offset,
SmoothScrollAlignmentType type) |
protected boolean |
shouldUpdate(Section previous,
Section next) |
protected void |
transferService(SectionContext c,
Section oldSection,
Section newSection)
Call this to transfer the Services between two
Section with the same global scope. |
protected void |
transferState(StateContainer previousStateContainer,
StateContainer nextStateContainer)
|
protected void |
unbindService(SectionContext c) |
protected void |
viewportChanged(SectionContext sectionContext,
int firstVisibleItem,
int lastVisibleItem,
int totalItemsCount,
int firstFullyVisibleItem,
int lastFullyVisibleItem) |
protected Children createChildren(SectionContext c)
GroupSectionSpec
method annotated with OnCreateChildren
protected void generateChangeSet(SectionContext c, ChangeSet changeSet, Section previous, Section next)
DiffSectionSpec
method annotated with OnDiff
protected void dataBound(SectionContext c)
Section
Spec method annotated with OnDataBound
protected void dataRendered(SectionContext c, boolean isDataChanged, boolean isMounted, long uptimeMillis, int firstVisibleIndex, int lastVisibleIndex, ChangesInfo changesInfo, int globalOffset)
Section
Spec method annotated with OnDataRendered
.protected void bindService(SectionContext c)
protected void unbindService(SectionContext c)
protected void createInitialState(SectionContext c)
protected void createService(SectionContext c)
public Object dispatchOnEvent(EventHandler eventHandler, Object eventState)
dispatchOnEvent
in interface EventDispatcher
public Object acceptTriggerEvent(EventTrigger eventTrigger, Object eventState, Object[] params)
acceptTriggerEvent
in interface EventTriggerTarget
protected void viewportChanged(SectionContext sectionContext, int firstVisibleItem, int lastVisibleItem, int totalItemsCount, int firstFullyVisibleItem, int lastFullyVisibleItem)
protected void refresh(SectionContext sectionContext)
protected void transferState(StateContainer previousStateContainer, StateContainer nextStateContainer)
protected void transferService(SectionContext c, Section oldSection, Section newSection)
Section
with the same global scope.public boolean isDiffSectionSpec()
protected static <E> EventHandler<E> newEventHandler(Class<? extends Section> reference, SectionContext c, int id, Object[] params)
protected static <E> EventHandler<E> newEventHandler(Section c, int id, Object[] params)
protected static <E> EventTrigger<E> newEventTrigger(SectionContext c, String childKey, int id, Handle handle)
protected static EventTrigger getEventTrigger(SectionContext c, int id, String key)
protected static EventTrigger getEventTrigger(SectionContext c, int id, Handle handle)
protected void populateTreeProps(TreeProps parentTreeProps)
protected TreeProps getTreePropsForChildren(SectionContext c, TreeProps previousTreeProps)
OnCreateTreeProp
methods.public static EventHandler getLoadingEventHandler(SectionContext context)
public static void dispatchLoadingEvent(SectionContext context, boolean isEmpty, LoadingEvent.LoadingState loadingState, Throwable t)
public static void requestFocus(SectionContext c, int index)
public static void requestFocus(SectionContext c, String sectionKey)
public static void requestFocus(SectionContext c, String sectionKey, FocusType focusType)
public static void requestFocusWithOffset(SectionContext c, int index, int offset)
requestFocus(SectionContext, int)
API is that this will *always* take an
action, while requestFocus(SectionContext, int)
will ignore the command if the item is
visible on the screen.offset
- distance, in pixels, from the top of the screen to scroll the requested itempublic static void requestFocusWithOffset(SectionContext c, String sectionKey, int offset)
requestFocus(SectionContext, String)
API is that this
will *always* take an action, while requestFocus(SectionContext, String)
will ignore
the command if the item is visible on the screen.sectionKey
- the key of the section component.offset
- distance, in pixels, from the top of the screen to scroll the requested item.public static void requestFocusWithOffset(SectionContext c, String sectionKey, int index, int offset)
requestFocus(SectionContext, String)
API is that this
will *always* take an action, while requestFocus(SectionContext, String)
will ignore
the command if the item is visible on the screen.sectionKey
- the key of the section component.index
- the index the section componentoffset
- distance, in pixels, from the top of the screen to scroll the requested item.public static void requestSmoothFocus(SectionContext c, int index)
public static void requestSmoothFocus(SectionContext c, int index, SmoothScrollAlignmentType type)
public static void requestSmoothFocus(SectionContext c, String keyString, int index, int offset, SmoothScrollAlignmentType type)
public static boolean isSectionIndexValid(SectionContext c, String keyString, int index)
keyString
- the key of the section componentindex
- the index in the section component