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 classWHeading.HeadingModelHolds 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 intMAJORDeprecated.UseHeadingLevelinsteadstatic intMINORDeprecated.UseHeadingLevelinsteadstatic intSECTIONDeprecated.UseHeadingLevelinsteadstatic intSUB_HEADINGDeprecated.UseHeadingLevelinsteadstatic intSUB_SUB_HEADINGDeprecated.UseHeadingLevelinsteadstatic intTITLEDeprecated.UseHeadingLevelinstead-
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 WComponentgetChildAt(int index)Retrieves a child component by its index.intgetChildCount()List<WComponent>getChildren()Retrieves a list of this Container's.protected WHeading.HeadingModelgetComponentModel()Returns the effective component model for this component.WDecoratedLabelgetDecoratedLabel()HeadingLevelgetHeadingLevel()intgetIndexOfChild(WComponent childComponent)Retrieves the index of the given child.MargingetMargin()Get the margin for the component, or null if not set.protected WHeading.HeadingModelgetOrCreateComponentModel()Retrieves the model for this component so that it can be modified.intgetType()Deprecated.usegetHeadingLevel()instead.protected WHeading.HeadingModelnewComponentModel()Creates a new Component model.voidsetHeadingLevel(HeadingLevel headingLevel)voidsetMargin(Margin margin)Set the margin for the component, or null for no margin.StringtoString()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.UseHeadingLevelinsteadTITLE Heading - Level 1.- See Also:
- Constant Field Values
-
MAJOR
@Deprecated public static final int MAJOR
Deprecated.UseHeadingLevelinsteadMAJOR Heading - Level 2.- See Also:
- Constant Field Values
-
SECTION
@Deprecated public static final int SECTION
Deprecated.UseHeadingLevelinsteadSECTION Heading - Level 3.- See Also:
- Constant Field Values
-
MINOR
@Deprecated public static final int MINOR
Deprecated.UseHeadingLevelinsteadMINOR Heading - Level 4.- See Also:
- Constant Field Values
-
SUB_HEADING
@Deprecated public static final int SUB_HEADING
Deprecated.UseHeadingLevelinsteadSUB Heading - Level 5.- See Also:
- Constant Field Values
-
SUB_SUB_HEADING
@Deprecated public static final int SUB_SUB_HEADING
Deprecated.UseHeadingLevelinsteadSUB_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_HEADINGtext- 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_HEADINGlabel- 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:
setMarginin 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:
getMarginin interfaceMarginable- Returns:
- the margin for the component, or null if not set
-
getChildCount
public int getChildCount()
- Specified by:
getChildCountin 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:
getChildAtin 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:
getIndexOfChildin 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:
getChildrenin interfaceContainer- Returns:
- an immutable list of this Container.
-
toString
public String toString()
Description copied from class:AbstractWComponentCreates a String representation of this component; usually for debugging purposes.
-
newComponentModel
protected WHeading.HeadingModel newComponentModel()
Creates a new Component model.- Overrides:
newComponentModelin 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:
getComponentModelin 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:
getOrCreateComponentModelin classWText- Returns:
- the model for this component
-
-