public abstract class Section extends SectionLifecycle implements java.lang.Cloneable, HasEventDispatcher, HasEventTrigger, Equivalence<Section>
Section
that is driven by its matching SectionLifecycle
. To create new Section
instances, use the create()
method in
the generated SectionLifecycle
subclass which returns a Section.Builder
that allows you
to set values for individual props. Section
instances are immutable after creation.Modifier and Type | Class and Description |
---|---|
static class |
Section.Builder<T extends Section.Builder<T>>
A builder to build a Section with a
SectionLifecycle L. |
Modifier | Constructor and Description |
---|---|
protected |
Section(java.lang.String simpleName) |
Modifier and Type | Method and Description |
---|---|
protected StateContainer |
createStateContainer() |
java.lang.String |
generateUniqueGlobalKeyForChild(Section section,
java.lang.String childKey) |
java.util.List<Section> |
getChildren() |
EventDispatcher |
getEventDispatcher() |
java.lang.String |
getGlobalKey() |
java.lang.String |
getLogTag() |
Section |
getParent() |
SectionContext |
getScopedContext() |
java.lang.String |
getSimpleName()
Mostly used by logging to provide more readable messages.
|
protected StateContainer |
getStateContainer() |
protected static StateContainer |
getStateContainer(ComponentContext c,
Section section) |
protected boolean |
isEquivalentProps(Section other,
boolean shouldCompareCommonProps) |
boolean |
isEquivalentTo(Section other)
Compares this section to a different one to check if they are the same
|
Section |
makeShallowCopy() |
Section |
makeShallowCopy(boolean deepCopy) |
void |
recordEventTrigger(ComponentContext c,
EventTriggersContainer container) |
void |
setChildren(Children children) |
void |
setCount(int count)
|
void |
setGlobalKey(java.lang.String key)
Set a unique key for this
Section within its tree. |
void |
setKey(java.lang.String key)
Sets the key for this Section.
|
void |
setScopedContext(SectionContext scopedContext) |
protected void |
setStateContainer(StateContainer stateContainer) |
acceptTriggerEvent, acceptTriggerEventImpl, bindService, createChildren, createInitialState, createService, dataBound, dataRendered, dispatchLoadingEvent, dispatchOnEvent, dispatchOnEventImpl, generateChangeSet, getEventTrigger, getEventTrigger, getLoadingEventHandler, getService, getTreePropsForChildren, isDiffSectionSpec, isSectionIndexValid, newEventHandler, newEventTrigger, newEventTrigger, populateTreeProps, refresh, requestFocus, requestFocus, requestFocus, requestFocusWithOffset, requestFocusWithOffset, requestFocusWithOffset, requestSmoothFocus, requestSmoothFocus, requestSmoothFocus, shouldUpdate, transferService, transferState, unbindService, verifyChangeSet, viewportChanged
public EventDispatcher getEventDispatcher()
getEventDispatcher
in interface HasEventDispatcher
public void recordEventTrigger(ComponentContext c, EventTriggersContainer container)
recordEventTrigger
in interface HasEventTrigger
public java.lang.String getGlobalKey()
Section
within its tree.public void setGlobalKey(java.lang.String key)
Section
within its tree.public void setKey(java.lang.String key)
Section.Builder
public void setCount(int count)
public java.util.List<Section> getChildren()
Section
.public Section makeShallowCopy(boolean deepCopy)
Section
. if deepCopy is false the clone won't contain any
children or count as it will be returned in a pre - ChangeSet generation state.public Section makeShallowCopy()
public SectionContext getScopedContext()
public void setScopedContext(SectionContext scopedContext)
public void setChildren(Children children)
public final java.lang.String getSimpleName()
protected boolean isEquivalentProps(Section other, boolean shouldCompareCommonProps)
public boolean isEquivalentTo(Section other)
This is used to be able to skip rendering a section again. We avoid using the Object.equals(Object)
so we can optimize the code better over time since we don't have to
adhere to the contract required for a equals method.
isEquivalentTo
in interface Equivalence<Section>
other
- the component to compare toprotected static StateContainer getStateContainer(ComponentContext c, Section section)
protected StateContainer getStateContainer()
protected void setStateContainer(StateContainer stateContainer)
protected StateContainer createStateContainer()
public java.lang.String generateUniqueGlobalKeyForChild(Section section, java.lang.String childKey)
public java.lang.String getLogTag()