Class WHeading
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WBeanComponent
-
- com.github.bordertech.wcomponents.WText
-
- com.github.bordertech.wcomponents.WHeading
-
- All Implemented Interfaces:
AjaxTarget
,BeanAware
,BeanBound
,BeanProviderBound
,Container
,DataBound
,Marginable
,WComponent
,WebComponent
,Serializable
public class WHeading extends WText implements Container, AjaxTarget, Marginable
This component is used to render the different types of headings within an application.- Author:
- Adam Millard, Yiannis Paschalidis
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WHeading.HeadingModel
Holds the extrinsic state information of the component.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.WText
WText.TextModel
-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAJOR
Deprecated.UseHeadingLevel
insteadstatic int
MINOR
Deprecated.UseHeadingLevel
insteadstatic int
SECTION
Deprecated.UseHeadingLevel
insteadstatic int
SUB_HEADING
Deprecated.UseHeadingLevel
insteadstatic int
SUB_SUB_HEADING
Deprecated.UseHeadingLevel
insteadstatic int
TITLE
Deprecated.UseHeadingLevel
instead-
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 WHeading(int type, WDecoratedLabel label)
Deprecated.UseWHeading(HeadingLevel, WDecoratedLabel)
instead.WHeading(int type, String text)
Deprecated.UseWHeading(HeadingLevel, String)
instead.WHeading(HeadingLevel headingLevel, WDecoratedLabel label)
Creates a WHeading.WHeading(HeadingLevel headingLevel, String text)
Creates a WHeading.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description WComponent
getChildAt(int index)
Retrieves a child component by its index.int
getChildCount()
List<WComponent>
getChildren()
Retrieves a list of this Container's.protected WHeading.HeadingModel
getComponentModel()
Returns the effective component model for this component.WDecoratedLabel
getDecoratedLabel()
HeadingLevel
getHeadingLevel()
int
getIndexOfChild(WComponent childComponent)
Retrieves the index of the given child.Margin
getMargin()
Get the margin for the component, or null if not set.protected WHeading.HeadingModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.int
getType()
Deprecated.usegetHeadingLevel()
instead.protected WHeading.HeadingModel
newComponentModel()
Creates a new Component model.void
setHeadingLevel(HeadingLevel headingLevel)
void
setMargin(Margin margin)
Set the margin for the component, or null for no margin.String
toString()
Creates a String representation of this component; usually for debugging purposes.-
Methods inherited from class com.github.bordertech.wcomponents.WText
getData, getText, isEncodeText, isSanitizeOnOutput, sanitizeOutputText, setEncodeText, setSanitizeOnOutput, setText
-
Methods inherited from class com.github.bordertech.wcomponents.WBeanComponent
addBeanToScratchMap, doUpdateBeanValue, getBean, getBeanFromScratchMap, getBeanId, getBeanProperty, getBeanProvider, getBeanScratchMap, getBeanValue, isBeanInScratchMap, isChanged, isSearchAncestors, isUseRequestScopeScratchMap, removeBeanFromScratchMap, resetData, setBean, setBeanId, setBeanProperty, setBeanProvider, setData, setSearchAncestors, updateBeanValue
-
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.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
-
-
-
-
Field Detail
-
TITLE
@Deprecated public static final int TITLE
Deprecated.UseHeadingLevel
insteadTITLE Heading - Level 1.- See Also:
- Constant Field Values
-
MAJOR
@Deprecated public static final int MAJOR
Deprecated.UseHeadingLevel
insteadMAJOR Heading - Level 2.- See Also:
- Constant Field Values
-
SECTION
@Deprecated public static final int SECTION
Deprecated.UseHeadingLevel
insteadSECTION Heading - Level 3.- See Also:
- Constant Field Values
-
MINOR
@Deprecated public static final int MINOR
Deprecated.UseHeadingLevel
insteadMINOR Heading - Level 4.- See Also:
- Constant Field Values
-
SUB_HEADING
@Deprecated public static final int SUB_HEADING
Deprecated.UseHeadingLevel
insteadSUB Heading - Level 5.- See Also:
- Constant Field Values
-
SUB_SUB_HEADING
@Deprecated public static final int SUB_SUB_HEADING
Deprecated.UseHeadingLevel
insteadSUB_SUB Heading - Level 6.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WHeading
@Deprecated public WHeading(int type, String text)
Deprecated.UseWHeading(HeadingLevel, String)
instead.Creates a WHeading.- Parameters:
type
- the heading type, one of:TITLE
,MAJOR
,SECTION
,MINOR
,SUB_HEADING
,SUB_SUB_HEADING
text
- the heading text
-
WHeading
@Deprecated public WHeading(int type, WDecoratedLabel label)
Deprecated.UseWHeading(HeadingLevel, WDecoratedLabel)
instead.Creates a WHeading.- Parameters:
type
- the heading type, one of:TITLE
,MAJOR
,SECTION
,MINOR
,SUB_HEADING
,SUB_SUB_HEADING
label
- the heading
-
WHeading
public WHeading(HeadingLevel headingLevel, String text)
Creates a WHeading.- Parameters:
headingLevel
- the heading leveltext
- the heading text
-
WHeading
public WHeading(HeadingLevel headingLevel, WDecoratedLabel label)
Creates a WHeading.- Parameters:
headingLevel
- the heading levellabel
- the heading
-
-
Method Detail
-
getType
@Deprecated public int getType()
Deprecated.usegetHeadingLevel()
instead.- Returns:
- the heading type.
-
getHeadingLevel
public HeadingLevel getHeadingLevel()
- Returns:
- the heading level
-
setHeadingLevel
public void setHeadingLevel(HeadingLevel headingLevel)
- Parameters:
headingLevel
- the heading level
-
getDecoratedLabel
public WDecoratedLabel getDecoratedLabel()
- Returns:
- the decorated label which displays the heading's text/icon etc.
-
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
-
getChildCount
public int getChildCount()
- Specified by:
getChildCount
in interfaceContainer
- Returns:
- the number of child components currently contained within this component.
-
getChildAt
public WComponent getChildAt(int index)
Retrieves a child component by its index.- Specified by:
getChildAt
in interfaceContainer
- Parameters:
index
- the index of the child component to be retrieved.- Returns:
- the child component at the given index.
-
getIndexOfChild
public int getIndexOfChild(WComponent childComponent)
Retrieves the index of the given child.- Specified by:
getIndexOfChild
in interfaceContainer
- Parameters:
childComponent
- the child component to retrieve the index for.- Returns:
- the index of the given child component, or -1 if the component is not a child of this component.
-
getChildren
public List<WComponent> getChildren()
Retrieves a list of this Container's.- Specified by:
getChildren
in interfaceContainer
- Returns:
- an immutable list of this Container.
-
toString
public String toString()
Description copied from class:AbstractWComponent
Creates a String representation of this component; usually for debugging purposes.
-
newComponentModel
protected WHeading.HeadingModel newComponentModel()
Creates a new Component model.- Overrides:
newComponentModel
in classWText
- Returns:
- a new HeadingModel.
-
getComponentModel
protected WHeading.HeadingModel 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 classWText
- Returns:
- the effective component model
-
getOrCreateComponentModel
protected WHeading.HeadingModel 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 classWText
- Returns:
- the model for this component
-
-