Class WebTextControlDepictor<V,C extends TextControl<V>>
- java.lang.Object
-
- io.guise.framework.platform.AbstractDepictor<C>
-
- io.guise.framework.platform.AbstractComponentDepictor<C>
-
- io.guise.framework.platform.web.AbstractWebComponentDepictor<C>
-
- io.guise.framework.platform.web.AbstractDecoratedWebComponentDepictor<C>
-
- io.guise.framework.platform.web.WebTextControlDepictor<V,C>
-
- Type Parameters:
V
- The type of value represented in the control.C
- The type of component being depicted.
- All Implemented Interfaces:
ComponentDepictor<C>
,Depictor<C>
,WebComponentDepictor<C>
,WebDepictor<C>
public class WebTextControlDepictor<V,C extends TextControl<V>> extends AbstractDecoratedWebComponentDepictor<C>
Strategy for rendering a text control as an XHTML<input>
element or an XHTML<textarea>
element. This view will change the XHTML element rendered based upon the number of rows requested by the text control. This implementation automatically converts between the controls LF end-of-line representation and the CRLF required by HTML <textarea>.- Author:
- Garret Wilson
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.guise.framework.platform.AbstractComponentDepictor
AbstractComponentDepictor.DepictedCompositeComponentListener
-
Nested classes/interfaces inherited from class io.guise.framework.platform.AbstractDepictor
AbstractDepictor.DepictedPropertyChangeListener
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
XSTANDARD_CLASS_ID
The XStandard class ID.static com.globalmentor.net.ContentType
XSTANDARD_CONTENT_TYPE
The content type for XStandard objects.-
Fields inherited from class io.guise.framework.platform.web.AbstractWebComponentDepictor
BODY_END_PATTERN, BODY_START_PATTERN
-
Fields inherited from class io.guise.framework.platform.AbstractComponentDepictor
childPropertyChangeListener
-
Fields inherited from interface io.guise.framework.platform.Depictor
GENERAL_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description WebTextControlDepictor()
Default constructor using the XHTML<input>
element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
depictBegin()
Begins the depiction process.protected void
depictBody()
Depicts the body of the component.java.lang.String
getBodyLocalName()
Determines the local name of the body XML element.protected java.lang.String
getInputType()
Determines the XHTML input type to use for getting input from the user.boolean
isEmptyBodyElementAllowed()
Determines whether an empty body element can be created if there is no content.void
processEvent(PlatformEvent event)
Processes an event from the platform.protected void
writeDecoratorEnd()
Writes the ending part of the outer decorator element.-
Methods inherited from class io.guise.framework.platform.web.AbstractDecoratedWebComponentDepictor
depictEnd, getBodyNamespaceURI, writeDecoratorBegin
-
Methods inherited from class io.guise.framework.platform.web.AbstractWebComponentDepictor
addFlowStyleIDs, decorateID, depict, getBackgroundColor, getBaseStyleIDs, getBodyStyleIDs, getBodyStyles, getColor, getDepictContext, getDepictName, getLabelStyles, getLabelStyles, getLabelStyles, getLocalName, getNamespaceURI, getOuterStyles, getPlatform, hasLabelContent, hasLabelContent, hasLabelContent, hasLabelContent, isEmptyElementAllowed, isMouseListener, writeBodyIDClassAttributes, writeClassAttribute, writeDirectionAttribute, writeDirectionAttribute, writeErrorMessage, writeFloatClear, writeIDAttribute, writeIDClassAttributes, writeLabel, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeLabelContent, writeParameterInputs, writeStyleAttribute, writeText
-
Methods inherited from class io.guise.framework.platform.AbstractComponentDepictor
depictChild, depictChildren, depictedObjectPropertyChange, getDepictedCompositeComponentListener, getErrorMessage, installed, uninstalled
-
Methods inherited from class io.guise.framework.platform.AbstractDepictor
getDepictedObject, getDepictedPropertyChangeListener, getIgnoredProperties, getModifiedProperties, getSession, isDepicted, setDepicted, setPropertyModified
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.guise.framework.platform.Depictor
getDepictedObject, getSession, installed, isDepicted, setDepicted, uninstalled
-
-
-
-
Field Detail
-
XSTANDARD_CONTENT_TYPE
public static final com.globalmentor.net.ContentType XSTANDARD_CONTENT_TYPE
The content type for XStandard objects.
-
XSTANDARD_CLASS_ID
public static final java.lang.String XSTANDARD_CLASS_ID
The XStandard class ID.- See Also:
- Constant Field Values
-
-
Method Detail
-
getBodyLocalName
public java.lang.String getBodyLocalName()
Determines the local name of the body XML element.This version returns the local name of the XHTML
<input>
element if exactly one row is specified, otherwise the local name of the XHTML<textarea>
.- Overrides:
getBodyLocalName
in classAbstractDecoratedWebComponentDepictor<C extends TextControl<V>>
- Returns:
- The local name of the element with no prefix, or
null
if this component should not be rendered as an element.
-
isEmptyBodyElementAllowed
public boolean isEmptyBodyElementAllowed()
Determines whether an empty body element can be created if there is no content.This version returns
true
for<input>
andfalse
for<textarea>
.- Overrides:
isEmptyBodyElementAllowed
in classAbstractDecoratedWebComponentDepictor<C extends TextControl<V>>
- Returns:
- Whether an empty body element can be created if there is no content.
- See Also:
getBodyLocalName()
-
getInputType
protected java.lang.String getInputType()
Determines the XHTML input type to use for getting input from the user.- Returns:
- One of the XHTML input types.
-
processEvent
public void processEvent(PlatformEvent event)
Description copied from class:AbstractComponentDepictor
Processes an event from the platform.This implementation handles
PlatformFocusEvent
.- Specified by:
processEvent
in interfaceDepictor<V>
- Overrides:
processEvent
in classAbstractComponentDepictor<C extends TextControl<V>>
- Parameters:
event
- The event to be processed.
-
depictBegin
protected void depictBegin() throws java.io.IOException
Description copied from class:AbstractDecoratedWebComponentDepictor
Begins the depiction process.This version renders the beginning XML element information, if there is any, leaving the beginning tag open for attributes.
This version writes common XHTML attributes.
This version calls
AbstractDecoratedWebComponentDepictor.writeDecoratorBegin()
.- Overrides:
depictBegin
in classAbstractDecoratedWebComponentDepictor<C extends TextControl<V>>
- Throws:
java.io.IOException
- if there is an error updating the depiction.
-
depictBody
protected void depictBody() throws java.io.IOException
Description copied from class:AbstractWebComponentDepictor
Depicts the body of the component.This version depicts the children of the component.
This version increases and decreases the indention level before and after depicting the children, respectively.
- Overrides:
depictBody
in classAbstractWebComponentDepictor<C extends TextControl<V>>
- Throws:
java.io.IOException
- if there is an error updating the depiction.- See Also:
AbstractComponentDepictor.depictChildren()
-
writeDecoratorEnd
protected void writeDecoratorEnd() throws java.io.IOException
Writes the ending part of the outer decorator element. This version writes the ending decorator items, such as the error message, if any.This version writes a dummy element for rich text editing if needed.
- Overrides:
writeDecoratorEnd
in classAbstractDecoratedWebComponentDepictor<C extends TextControl<V>>
- Throws:
java.io.IOException
- if there is an error rendering the component.- See Also:
AbstractWebComponentDepictor.writeErrorMessage()
-
-