public abstract class Section extends SectionLifecycle implements 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(String simpleName) |
Modifier and Type | Method and Description |
---|---|
String |
generateUniqueGlobalKeyForChild(Section section,
String childKey) |
List<Section> |
getChildren() |
EventDispatcher |
getEventDispatcher() |
String |
getGlobalKey() |
protected Handle |
getHandle() |
protected String |
getKey() |
String |
getLogTag() |
Section |
getParent() |
SectionContext |
getScopedContext() |
String |
getSimpleName()
Mostly used by logging to provide more readable messages.
|
protected StateContainer |
getStateContainer() |
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(EventTriggersContainer container) |
void |
setChildren(Children children) |
void |
setCount(int count)
|
void |
setGlobalKey(String key)
Set a unique key for this
Section within its tree. |
void |
setKey(String key)
Sets the key for this Section.
|
void |
setScopedContext(SectionContext scopedContext) |
acceptTriggerEvent, bindService, createChildren, createInitialState, createService, dataBound, dataRendered, dispatchLoadingEvent, dispatchOnEvent, generateChangeSet, getEventTrigger, getEventTrigger, getLoadingEventHandler, getService, getTreePropsForChildren, isDiffSectionSpec, isSectionIndexValid, newEventHandler, newEventHandler, newEventTrigger, populateTreeProps, refresh, requestFocus, requestFocus, requestFocus, requestFocusWithOffset, requestFocusWithOffset, requestFocusWithOffset, requestSmoothFocus, requestSmoothFocus, requestSmoothFocus, shouldUpdate, transferService, transferState, unbindService, viewportChanged
protected Section(String simpleName)
public EventDispatcher getEventDispatcher()
getEventDispatcher
in interface HasEventDispatcher
public void recordEventTrigger(EventTriggersContainer container)
recordEventTrigger
in interface HasEventTrigger
public void setGlobalKey(String key)
Section
within its tree.protected String getKey()
Section
that is local between its siblings. A parent is
responsible to set different localScopes to children with the same SectionLifecycle
.public void setKey(String key)
Section.Builder
public void setCount(int count)
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 String getSimpleName()
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 StateContainer getStateContainer()
public String generateUniqueGlobalKeyForChild(Section section, String childKey)
public String getLogTag()