Class WStyledText
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.WBeanComponent
-
- com.github.bordertech.wcomponents.WText
-
- com.github.bordertech.wcomponents.WStyledText
-
- All Implemented Interfaces:
BeanAware
,BeanBound
,BeanProviderBound
,DataBound
,WComponent
,WebComponent
,Serializable
public class WStyledText extends WText
This component is used to render the different types of text. If the text contains special characters, they will be escaped automatically, as in
WText
.Note that the visual representation of the different types of text will depend on the current Theme in use.
- Since:
- 1.0.0
- Author:
- Yiannis Paschalidis
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WStyledText.StyledTextModel
Holds the extrinsic state information of a WStyledText.static class
WStyledText.Type
The available types of text.static class
WStyledText.WhitespaceMode
Specifies how white-space should be handled.-
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 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 WStyledText()
Creates a plain WStyledText with no text.WStyledText(String text)
Creates a plain WStyledText with the given text.WStyledText(String text, WStyledText.Type type)
Creates a plain WStyledText with the given text and type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WStyledText.StyledTextModel
getComponentModel()
Returns the effective component model for this component.protected WStyledText.StyledTextModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.WStyledText.Type
getType()
WStyledText.WhitespaceMode
getWhitespaceMode()
protected WStyledText.StyledTextModel
newComponentModel()
Creates a new Component model.void
setType(WStyledText.Type type)
void
setWhitespaceMode(WStyledText.WhitespaceMode mode)
-
Methods inherited from class com.github.bordertech.wcomponents.WText
getData, getText, isEncodeText, isSanitizeOnOutput, sanitizeOutputText, setEncodeText, setSanitizeOnOutput, setText, toString
-
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
-
-
-
-
Constructor Detail
-
WStyledText
public WStyledText()
Creates a plain WStyledText with no text.
-
WStyledText
public WStyledText(String text)
Creates a plain WStyledText with the given text.- Parameters:
text
- the text.
-
WStyledText
public WStyledText(String text, WStyledText.Type type)
Creates a plain WStyledText with the given text and type.- Parameters:
text
- the text.type
- the type of styling to use.
-
-
Method Detail
-
getType
public WStyledText.Type getType()
- Returns:
- Returns the type.
-
setType
public void setType(WStyledText.Type type)
- Parameters:
type
- The type to set.
-
getWhitespaceMode
public WStyledText.WhitespaceMode getWhitespaceMode()
- Returns:
- Returns the white-space mode.
-
setWhitespaceMode
public void setWhitespaceMode(WStyledText.WhitespaceMode mode)
- Parameters:
mode
- The mode to set.
-
newComponentModel
protected WStyledText.StyledTextModel newComponentModel()
Creates a new Component model.- Overrides:
newComponentModel
in classWText
- Returns:
- a new StyledTextModel.
-
getComponentModel
protected WStyledText.StyledTextModel 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 WStyledText.StyledTextModel 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
-
-