Class A_CmsFormFieldPanel
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Composite
-
- org.opencms.gwt.client.ui.input.form.A_CmsFormFieldPanel
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.shared.HasHandlers
,com.google.gwt.user.client.EventListener
,com.google.gwt.user.client.ui.HasVisibility
,com.google.gwt.user.client.ui.IsRenderable
,com.google.gwt.user.client.ui.IsWidget
,I_CmsTruncable
- Direct Known Subclasses:
CmsFieldsetFormFieldPanel
,CmsInfoBoxFormFieldPanel
,CmsPropertyPanel
,CmsSimpleFormFieldPanel
,CmsUserSettingsFormFieldPanel
public abstract class A_CmsFormFieldPanel extends com.google.gwt.user.client.ui.Composite implements I_CmsTruncable
The abstract class for form field container widgets.- Since:
- 8.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected CmsListItemWidget
m_infoWidget
The info widget.protected java.lang.String
m_truncationMetricsKey
Stored truncation text metrics key.protected int
m_truncationWidth
Stored truncation width.static java.lang.String
NO_DESCRIPTION
-
Constructor Summary
Constructors Constructor Description A_CmsFormFieldPanel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected CmsFormRow
createRow(java.lang.String labelText, java.lang.String description, com.google.gwt.user.client.ui.Widget widget)
Creates a form row.protected CmsFormRow
createRow(java.lang.String labelText, java.lang.String description, com.google.gwt.user.client.ui.Widget widget, java.lang.String infoText, boolean infoIsHtml)
Adds a new row with a given label and input widget to the form.protected CmsFormRow
createRow(I_CmsFormField field)
Helper method for creating a form row widget.abstract java.lang.String
getDefaultGroup()
Returns the default group name.CmsListItemWidget
getInfoWidget()
Returns the info widget.abstract void
renderFields(java.util.Collection<I_CmsFormField> fields)
Renders a collection of fields.void
rerenderFields(java.lang.String group, java.util.Collection<I_CmsFormField> fieldsInGroup)
Re-renders the fields of a group.protected void
setBorder(com.google.gwt.user.client.ui.Widget widget)
Helper method for adding a border to a widget.protected void
storeTruncation(java.lang.String textMetricsKey, int clientWidth)
Stores the truncation data to be used when new rows are created.protected void
truncatePanel(com.google.gwt.user.client.ui.Panel panel, java.lang.String textMetricsKey, int clientWidth)
Truncates all children of the given panel implementing the I_CmsTruncable.-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opencms.gwt.client.ui.I_CmsTruncable
truncate
-
-
-
-
Field Detail
-
NO_DESCRIPTION
public static final java.lang.String NO_DESCRIPTION
- See Also:
- Constant Field Values
-
m_truncationMetricsKey
protected java.lang.String m_truncationMetricsKey
Stored truncation text metrics key.
-
m_truncationWidth
protected int m_truncationWidth
Stored truncation width.
-
m_infoWidget
protected CmsListItemWidget m_infoWidget
The info widget.
-
-
Constructor Detail
-
A_CmsFormFieldPanel
public A_CmsFormFieldPanel()
-
-
Method Detail
-
getDefaultGroup
public abstract java.lang.String getDefaultGroup()
Returns the default group name.- Returns:
- the default group name
-
getInfoWidget
public CmsListItemWidget getInfoWidget()
Returns the info widget.- Returns:
- the info widget
-
renderFields
public abstract void renderFields(java.util.Collection<I_CmsFormField> fields)
Renders a collection of fields.This should only be called once, when the form is being built.
- Parameters:
fields
- the fields to render
-
rerenderFields
public void rerenderFields(java.lang.String group, java.util.Collection<I_CmsFormField> fieldsInGroup)
Re-renders the fields of a group.Not supported by all subclasses.
- Parameters:
group
- the group whose fields to re-renderfieldsInGroup
- the fields to re-render
-
createRow
protected CmsFormRow createRow(I_CmsFormField field)
Helper method for creating a form row widget.- Parameters:
field
- the field for which to create a form row- Returns:
- the newly created form row
-
createRow
protected CmsFormRow createRow(java.lang.String labelText, java.lang.String description, com.google.gwt.user.client.ui.Widget widget)
Creates a form row.- Parameters:
labelText
- the label textdescription
- the descriptionwidget
- the widget to use- Returns:
- the new form row
-
createRow
protected CmsFormRow createRow(java.lang.String labelText, java.lang.String description, com.google.gwt.user.client.ui.Widget widget, java.lang.String infoText, boolean infoIsHtml)
Adds a new row with a given label and input widget to the form.- Parameters:
labelText
- the label text for the form fielddescription
- the description of the form fieldwidget
- the widget for the form fieldinfoText
- the text to display on the info icon (may be null)infoIsHtml
- true if the info text should be interpreted as HTML rather than plain text- Returns:
- the newly added form row
-
setBorder
protected void setBorder(com.google.gwt.user.client.ui.Widget widget)
Helper method for adding a border to a widget.- Parameters:
widget
- the widget which a border should be added to
-
storeTruncation
protected void storeTruncation(java.lang.String textMetricsKey, int clientWidth)
Stores the truncation data to be used when new rows are created.- Parameters:
textMetricsKey
- the text metrics keyclientWidth
- the client width
-
truncatePanel
protected void truncatePanel(com.google.gwt.user.client.ui.Panel panel, java.lang.String textMetricsKey, int clientWidth)
Truncates all children of the given panel implementing the I_CmsTruncable.- Parameters:
panel
- the paneltextMetricsKey
- the metrics keyclientWidth
- the client width
-
-