Package org.opencms.acacia.client
Class CmsRenderer
- java.lang.Object
-
- org.opencms.acacia.client.CmsRenderer
-
- All Implemented Interfaces:
I_CmsEntityRenderer
public class CmsRenderer extends java.lang.Object implements I_CmsEntityRenderer
Renders the widgets for an in-line form.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CmsRenderer.TabSelectionHandler
Calls resize on tab selection on the tabs child hierarchy.protected class
CmsRenderer.TabSizeHandler
Handles the size of a tabbed panel.protected class
CmsRenderer.WidgetChangeHandler
The widget value change handler.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ENTITY_CLASS
The entity CSS class.static java.lang.String
LABEL_CLASS
The attribute label CSS class.static java.lang.String
RENDERER_NAME
The renderer name.static java.lang.String
WIDGET_HOLDER_CLASS
The widget holder CSS class.
-
Constructor Summary
Constructors Constructor Description CmsRenderer(I_CmsEntityBackend entityBackEnd, I_CmsWidgetService widgetService)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description I_CmsEntityRenderer
configure(java.lang.String configuration)
Returns a copy of this renderer which has been configured with the given configuration string.protected org.opencms.acacia.shared.CmsEntityAttribute
createEmptyAttribute(org.opencms.acacia.shared.CmsEntity parentEntity, java.lang.String attributeName, CmsAttributeHandler handler, int minOccurrence)
Creates an empty attribute.static java.util.List<CmsChoiceMenuEntryBean>
getChoiceEntries(org.opencms.acacia.shared.CmsType attributeType, boolean startingAtChoiceAttribute)
Gets the paths of nested choice attributes starting from a given type.java.lang.String
getName()
Gets the name of the renderer (should be unique for each renderer class).void
renderAttributeValue(org.opencms.acacia.shared.CmsEntity parentEntity, CmsAttributeHandler attributeHandler, int attributeIndex, com.google.gwt.user.client.ui.Panel context)
Renders a single attribute value.void
renderForm(org.opencms.acacia.shared.CmsEntity entity, com.google.gwt.user.client.ui.Panel context, I_CmsAttributeHandler parentHandler, int attributeIndex)
Renders the given entity into a form.CmsTabbedPanel<com.google.gwt.user.client.ui.FlowPanel>
renderForm(org.opencms.acacia.shared.CmsEntity entity, java.util.List<org.opencms.acacia.shared.CmsTabInfo> tabInfos, com.google.gwt.user.client.ui.Panel context, I_CmsAttributeHandler parentHandler, int attributeIndex)
Renders the given entity into a form with tabs.void
renderInline(org.opencms.acacia.shared.CmsEntity parentEntity, java.lang.String attributeName, I_CmsInlineFormParent formParent, I_CmsInlineHtmlUpdateHandler updateHandler, I_CmsAttributeHandler parentHandler, int attributeIndex, int minOccurrence, int maxOccurrence)
Injects editing widgets into the given DOM context to enable editing of the given entity attribute.void
renderInline(org.opencms.acacia.shared.CmsEntity entity, I_CmsInlineFormParent formParent, I_CmsInlineHtmlUpdateHandler updateHandler, I_CmsAttributeHandler parentHandler, int attributeIndex)
Injects editing widgets into the given DOM context to enable editing of the given entity.static void
setAttributeChoice(I_CmsWidgetService widgetService, CmsAttributeValueView valueWidget, org.opencms.acacia.shared.CmsType attributeType)
Sets the attribute choices if present.
-
-
-
Field Detail
-
ENTITY_CLASS
public static final java.lang.String ENTITY_CLASS
The entity CSS class.
-
LABEL_CLASS
public static final java.lang.String LABEL_CLASS
The attribute label CSS class.
-
RENDERER_NAME
public static final java.lang.String RENDERER_NAME
The renderer name.- See Also:
- Constant Field Values
-
WIDGET_HOLDER_CLASS
public static final java.lang.String WIDGET_HOLDER_CLASS
The widget holder CSS class.
-
-
Constructor Detail
-
CmsRenderer
public CmsRenderer(I_CmsEntityBackend entityBackEnd, I_CmsWidgetService widgetService)
Constructor.- Parameters:
entityBackEnd
- the entity back end instancewidgetService
- the widget service
-
-
Method Detail
-
getChoiceEntries
public static java.util.List<CmsChoiceMenuEntryBean> getChoiceEntries(org.opencms.acacia.shared.CmsType attributeType, boolean startingAtChoiceAttribute)
Gets the paths of nested choice attributes starting from a given type.- Parameters:
attributeType
- the type from which to startstartingAtChoiceAttribute
- true if the attribute is a synthetic CHOICE_ATTRIBUTE- Returns:
- the list of nested choice attribute name paths
-
setAttributeChoice
public static void setAttributeChoice(I_CmsWidgetService widgetService, CmsAttributeValueView valueWidget, org.opencms.acacia.shared.CmsType attributeType)
Sets the attribute choices if present.- Parameters:
widgetService
- the widget service to usevalueWidget
- the value widgetattributeType
- the attribute type
-
configure
public I_CmsEntityRenderer configure(java.lang.String configuration)
Description copied from interface:I_CmsEntityRenderer
Returns a copy of this renderer which has been configured with the given configuration string.- Specified by:
configure
in interfaceI_CmsEntityRenderer
- Parameters:
configuration
- the configuration string- Returns:
- the configured copy of the renderer
- See Also:
I_CmsEntityRenderer.configure(java.lang.String)
-
getName
public java.lang.String getName()
Description copied from interface:I_CmsEntityRenderer
Gets the name of the renderer (should be unique for each renderer class).- Specified by:
getName
in interfaceI_CmsEntityRenderer
- Returns:
- the renderer name
- See Also:
I_CmsEntityRenderer.getName()
-
renderAttributeValue
public void renderAttributeValue(org.opencms.acacia.shared.CmsEntity parentEntity, CmsAttributeHandler attributeHandler, int attributeIndex, com.google.gwt.user.client.ui.Panel context)
Description copied from interface:I_CmsEntityRenderer
Renders a single attribute value. Used for inline editing to show a fragment of the form.- Specified by:
renderAttributeValue
in interfaceI_CmsEntityRenderer
- Parameters:
parentEntity
- the parent entityattributeHandler
- the attribute handlerattributeIndex
- the value indexcontext
- the parent widget- See Also:
I_CmsEntityRenderer.renderAttributeValue(org.opencms.acacia.shared.CmsEntity, org.opencms.acacia.client.CmsAttributeHandler, int, com.google.gwt.user.client.ui.Panel)
-
renderForm
public CmsTabbedPanel<com.google.gwt.user.client.ui.FlowPanel> renderForm(org.opencms.acacia.shared.CmsEntity entity, java.util.List<org.opencms.acacia.shared.CmsTabInfo> tabInfos, com.google.gwt.user.client.ui.Panel context, I_CmsAttributeHandler parentHandler, int attributeIndex)
Description copied from interface:I_CmsEntityRenderer
Renders the given entity into a form with tabs.- Specified by:
renderForm
in interfaceI_CmsEntityRenderer
- Parameters:
entity
- the entity to rendertabInfos
- the tab infoscontext
- the context widget panelparentHandler
- the parent attribute handlerattributeIndex
- the attribute index- Returns:
- the tabbed panel
- See Also:
I_CmsEntityRenderer.renderForm(org.opencms.acacia.shared.CmsEntity, java.util.List, com.google.gwt.user.client.ui.Panel, org.opencms.acacia.client.I_CmsAttributeHandler, int)
-
renderForm
public void renderForm(org.opencms.acacia.shared.CmsEntity entity, com.google.gwt.user.client.ui.Panel context, I_CmsAttributeHandler parentHandler, int attributeIndex)
Description copied from interface:I_CmsEntityRenderer
Renders the given entity into a form.- Specified by:
renderForm
in interfaceI_CmsEntityRenderer
- Parameters:
entity
- the entity to rendercontext
- the context widget panelparentHandler
- the parent attribute handlerattributeIndex
- the attribute index- See Also:
I_CmsEntityRenderer.renderForm(org.opencms.acacia.shared.CmsEntity, com.google.gwt.user.client.ui.Panel, org.opencms.acacia.client.I_CmsAttributeHandler, int)
-
renderInline
public void renderInline(org.opencms.acacia.shared.CmsEntity entity, I_CmsInlineFormParent formParent, I_CmsInlineHtmlUpdateHandler updateHandler, I_CmsAttributeHandler parentHandler, int attributeIndex)
Description copied from interface:I_CmsEntityRenderer
Injects editing widgets into the given DOM context to enable editing of the given entity.- Specified by:
renderInline
in interfaceI_CmsEntityRenderer
- Parameters:
entity
- the entity to renderformParent
- formParent the form parent widgetupdateHandler
- handles updates on the HTML required due to entity data changesparentHandler
- the parent attribute handlerattributeIndex
- the attribute index- See Also:
I_CmsEntityRenderer.renderInline(org.opencms.acacia.shared.CmsEntity, org.opencms.acacia.client.I_CmsInlineFormParent, org.opencms.acacia.client.I_CmsInlineHtmlUpdateHandler, org.opencms.acacia.client.I_CmsAttributeHandler, int)
-
renderInline
public void renderInline(org.opencms.acacia.shared.CmsEntity parentEntity, java.lang.String attributeName, I_CmsInlineFormParent formParent, I_CmsInlineHtmlUpdateHandler updateHandler, I_CmsAttributeHandler parentHandler, int attributeIndex, int minOccurrence, int maxOccurrence)
Description copied from interface:I_CmsEntityRenderer
Injects editing widgets into the given DOM context to enable editing of the given entity attribute.- Specified by:
renderInline
in interfaceI_CmsEntityRenderer
- Parameters:
parentEntity
- the parent entityattributeName
- the attribute nameformParent
- the form parent widgetupdateHandler
- handles updates on the HTML required due to entity data changesparentHandler
- the parent attribute handlerattributeIndex
- the attribute indexminOccurrence
- the minimum occurrence of this attributemaxOccurrence
- the maximum occurrence of this attribute- See Also:
I_CmsEntityRenderer.renderInline(org.opencms.acacia.shared.CmsEntity, java.lang.String, org.opencms.acacia.client.I_CmsInlineFormParent, org.opencms.acacia.client.I_CmsInlineHtmlUpdateHandler, org.opencms.acacia.client.I_CmsAttributeHandler, int, int, int)
-
createEmptyAttribute
protected org.opencms.acacia.shared.CmsEntityAttribute createEmptyAttribute(org.opencms.acacia.shared.CmsEntity parentEntity, java.lang.String attributeName, CmsAttributeHandler handler, int minOccurrence)
Creates an empty attribute.- Parameters:
parentEntity
- the parent entityattributeName
- the attribute namehandler
- the attribute handlerminOccurrence
- the minimum occurrence of the attribute- Returns:
- the entity attribute
-
-