Class WSection
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.AbstractContainer
-
- com.github.bordertech.wcomponents.AbstractNamingContextContainer
-
- com.github.bordertech.wcomponents.WSection
-
- All Implemented Interfaces:
AjaxInternalTrigger
,AjaxTarget
,Container
,DropZone
,Marginable
,NamingContextable
,SubordinateTarget
,WComponent
,WebComponent
,Serializable
public class WSection extends AbstractNamingContextContainer implements AjaxInternalTrigger, AjaxTarget, SubordinateTarget, Marginable, DropZone
The WSection component defines a major discrete section of a screen which is associated with, and described by, a heading.
Various
modes of operation
are supported, which allow developers to tune performance by only loading content when it is needed.- Since:
- 1.0.0
- Author:
- Jonathan Austin
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WSection.SectionMode
The available types of section mode.static class
WSection.SectionModel
Holds the extrinsic state information of a WSection.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
-
Fields inherited from interface com.github.bordertech.wcomponents.WComponent
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
-
-
Constructor Summary
Constructors Constructor Description WSection(WPanel content, WDecoratedLabel label)
Creates a WSection with the given content and heading.WSection(WPanel content, String heading)
Creates a WSection with the given content and heading.WSection(String heading)
Creates a WSection with the given heading.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WSection.SectionModel
getComponentModel()
Returns the effective component model for this component.WPanel
getContent()
WDecoratedLabel
getDecoratedLabel()
Margin
getMargin()
Get the margin for the component, or null if not set.WSection.SectionMode
getMode()
protected WSection.SectionModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.protected WSection.SectionModel
newComponentModel()
Creates a new component model appropriate for this component.void
setMargin(Margin margin)
Set the margin for the component, or null for no margin.void
setMode(WSection.SectionMode mode)
Sets this WSection's mode of operation.String
toString()
Creates a String representation of this component; usually for debugging purposes.-
Methods inherited from class com.github.bordertech.wcomponents.AbstractNamingContextContainer
getNamingContextId, isNamingContext, setNamingContext
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractContainer
getChildAt, getChildCount, getChildren, getIndexOfChild
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWComponent
addHtmlClass, addHtmlClass, addNotify, afterPaint, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, handleRequest, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, paintComponent, preparePaint, preparePaintComponent, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showErrorIndicatorsForComponent, showWarningIndicators, showWarningIndicatorsForComponent, tidyUpUIContext, tidyUpUIContextForTree, validate, validateComponent, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.bordertech.wcomponents.Container
getChildAt, getChildCount, getChildren, getIndexOfChild
-
Methods inherited from interface com.github.bordertech.wcomponents.WComponent
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, handleRequest, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContextForTree, validate
-
-
-
-
Constructor Detail
-
WSection
public WSection(String heading)
Creates a WSection with the given heading.- Parameters:
heading
- the section's heading.
-
WSection
public WSection(WPanel content, String heading)
Creates a WSection with the given content and heading.- Parameters:
content
- the content for the sectionheading
- the section's heading.
-
WSection
public WSection(WPanel content, WDecoratedLabel label)
Creates a WSection with the given content and heading.- Parameters:
content
- the content for the section.label
- the section's heading.
-
-
Method Detail
-
getMode
public WSection.SectionMode getMode()
- Returns:
- this WSection's mode of operation
-
setMode
public void setMode(WSection.SectionMode mode)
Sets this WSection's mode of operation.- Parameters:
mode
- the mode of operation.
-
getContent
public WPanel getContent()
- Returns:
- the content of this section
-
getDecoratedLabel
public WDecoratedLabel getDecoratedLabel()
- Returns:
- the decorated label that is used to render the section heading.
-
setMargin
public void setMargin(Margin margin)
Set the margin for the component, or null for no margin.- Specified by:
setMargin
in interfaceMarginable
- Parameters:
margin
- the margin for the component
-
getMargin
public Margin getMargin()
Get the margin for the component, or null if not set.- Specified by:
getMargin
in interfaceMarginable
- Returns:
- the margin for the component, or null if not set
-
toString
public String toString()
Description copied from class:AbstractWComponent
Creates a String representation of this component; usually for debugging purposes.- Overrides:
toString
in classAbstractWComponent
- Returns:
- a String representation of this component, for debugging purposes.
-
newComponentModel
protected WSection.SectionModel newComponentModel()
Creates a new component model appropriate for this component.- Overrides:
newComponentModel
in classAbstractWComponent
- Returns:
- a new SectionModel.
-
getComponentModel
protected WSection.SectionModel getComponentModel()
Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.- Overrides:
getComponentModel
in classAbstractWComponent
- Returns:
- the effective component model
-
getOrCreateComponentModel
protected WSection.SectionModel getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.- Overrides:
getOrCreateComponentModel
in classAbstractWComponent
- Returns:
- the model for this component
-
-