public abstract class SectionLifecycle extends java.lang.Object implements EventDispatcher, EventTriggerTarget
Constructor and Description |
---|
SectionLifecycle() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
acceptTriggerEvent(EventTrigger eventTrigger,
java.lang.Object eventState,
java.lang.Object[] params) |
protected java.lang.Object |
acceptTriggerEventImpl(EventTrigger eventTrigger,
java.lang.Object eventState,
java.lang.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,
java.lang.Throwable t) |
java.lang.Object |
dispatchOnEvent(EventHandler eventHandler,
java.lang.Object eventState) |
protected java.lang.Object |
dispatchOnEventImpl(EventHandler eventHandler,
java.lang.Object eventState) |
protected void |
generateChangeSet(SectionContext c,
ChangeSet changeSet,
SectionContext previousContext,
Section previous,
SectionContext nextContext,
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,
java.lang.String key) |
static EventHandler |
getLoadingEventHandler(SectionContext context) |
protected java.lang.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,
java.lang.String keyString,
int index)
Check to see if an index provided for within a section is valid
|
protected static <E> EventHandler<E> |
newEventHandler(java.lang.Class<? extends Section> reference,
java.lang.String className,
SectionContext c,
int id,
java.lang.Object[] params) |
protected static <E> EventTrigger<E> |
newEventTrigger(SectionContext c,
Section section,
int methodId)
This variant is used to create an EventTrigger used to register this component as a target in
EventTriggersContainer |
protected static <E> EventTrigger<E> |
newEventTrigger(SectionContext c,
java.lang.String childKey,
int methodId)
Deprecated.
|
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,
java.lang.String sectionKey)
Scroll to the beginning of the section with the given key.
|
static void |
requestFocus(SectionContext c,
java.lang.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,
java.lang.String sectionKey,
int offset)
Scroll to the beginning of the section with the given key and an additional offset.
|
static void |
requestFocusWithOffset(SectionContext c,
java.lang.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,
java.lang.String keyString,
int index,
int offset,
SmoothScrollAlignmentType type) |
protected boolean |
shouldUpdate(SectionContext previousScopedContext,
Section previous,
SectionContext nextScopedContext,
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 java.lang.String |
verifyChangeSet(SectionContext context) |
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, SectionContext previousContext, Section previous, SectionContext nextContext, 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 final java.lang.Object dispatchOnEvent(EventHandler eventHandler, java.lang.Object eventState)
dispatchOnEvent
in interface EventDispatcher
protected java.lang.Object dispatchOnEventImpl(EventHandler eventHandler, java.lang.Object eventState)
public final java.lang.Object acceptTriggerEvent(EventTrigger eventTrigger, java.lang.Object eventState, java.lang.Object[] params)
acceptTriggerEvent
in interface EventTriggerTarget
protected java.lang.Object acceptTriggerEventImpl(EventTrigger eventTrigger, java.lang.Object eventState, java.lang.Object[] params)
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.protected java.lang.Object getService(Section section)
protected boolean shouldUpdate(SectionContext previousScopedContext, Section previous, SectionContext nextScopedContext, Section next)
public boolean isDiffSectionSpec()
protected java.lang.String verifyChangeSet(SectionContext context)
protected static <E> EventHandler<E> newEventHandler(java.lang.Class<? extends Section> reference, java.lang.String className, SectionContext c, int id, java.lang.Object[] params)
protected static <E> EventTrigger<E> newEventTrigger(SectionContext c, Section section, int methodId)
EventTriggersContainer
@Deprecated protected static <E> EventTrigger<E> newEventTrigger(SectionContext c, java.lang.String childKey, int methodId)
protected static EventTrigger getEventTrigger(SectionContext c, int id, java.lang.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, java.lang.Throwable t)
public static void requestFocus(SectionContext c, int index)
public static void requestFocus(SectionContext c, java.lang.String sectionKey)
public static void requestFocus(SectionContext c, java.lang.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, java.lang.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, java.lang.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, java.lang.String keyString, int index, int offset, SmoothScrollAlignmentType type)
public static boolean isSectionIndexValid(SectionContext c, java.lang.String keyString, int index)
keyString
- the key of the section componentindex
- the index in the section component