Package com.day.cq.wcm.core.components
Class CustomEditConfig
- java.lang.Object
 - 
- com.day.cq.wcm.core.components.CustomEditConfig
 
 
- 
- All Implemented Interfaces:
 JSONItem,ComponentEditConfig,EditConfig
public class CustomEditConfig extends java.lang.Object implements EditConfig
Helper class to create a edit config if not edit context is available. 
- 
- 
Field Summary
- 
Fields inherited from interface com.day.cq.wcm.api.components.EditConfig
LISTENER_AFTERCREATE, LISTENER_AFTERDELETE, LISTENER_AFTEREDIT, LISTENER_AFTERINSERT, LISTENER_AFTERMOVE, LISTENER_AFTERREMOVE, REFRESH_PAGE, REFRESH_PARENT, REFRESH_SELF 
 - 
 
- 
Constructor Summary
Constructors Constructor Description CustomEditConfig(ComponentEditConfig cfg) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawEditing(java.io.PrintWriter out, java.lang.String contentPath, java.lang.String resourceType, java.lang.String dlgPath, Cell cell, boolean isContainer)DialogModegetDialogMode()Returns the display mode of the dialogjava.util.Map<java.lang.String,DropTarget>getDropTargets()Returns amap of configurations of drop targets.java.lang.StringgetEmptyText()Gets the text to be displayed whenComponentEditConfig.isEmpty()istrue.java.util.Map<java.lang.String,java.lang.Object>getFormParameterMap()Returns the additional form parameters to be included in the dialog.java.util.Map<java.lang.String,java.lang.String>getFormParameters()Returns a modifiable map for additional form parameters to be included in the dialog.InplaceEditingConfiggetInplaceEditingConfig()Returns the configuration for inplace editing of this configuration.java.lang.StringgetInsertBehavior()Returns the insert behavior ornullof not definedEditLayoutgetLayout()Returns the edit layout for the edit control widget.java.util.Map<java.lang.String,java.lang.String>getListeners()Returns a modifiable map of edit listenersJSONItemgetLiveRelationship()Returns the component live relationship.ToolbargetToolbar()Returns the (modifiable) toolbar for the editbar/menu.java.lang.BooleanisDeepCancel()Returns if cancelling inheritance of the component sets the cq:isCancelledForChildren flag or not.booleanisDefault()Checks if this config has all default values in respect to the default values of the widgets.booleanisEmpty()Returns theemptyflag.java.lang.BooleanisOrderable()Returns if the edited component is orderable.booleanisTargetingDisabled()Returns if targeting is disabled for this component.voidsetDeepCancel(java.lang.Boolean deepCancel)Sets if cancelling inheritance of the component sets the cq:isCancelledForChildren flag or not.voidsetDialogMode(DialogMode mode)Sets the dialog modevoidsetEmpty(boolean empty)Sets theemptyflag.voidsetEmptyText(java.lang.String emptyText)Sets the text to be displayed whenComponentEditConfig.isEmpty()istrue.voidsetInplaceEditingConfig(InplaceEditingConfig inplaceEditingConfig)Sets the inplace editing configuration.voidsetInsertBehavior(java.lang.String insertBehavior)Sets the insert behaviorvoidsetLayout(EditLayout layout)Sets the edit layout for the edit control widget.voidsetLiveRelationship(JSONItem liveRelationship)Set the computed live relationship of the component TODO seems like we are only considering this as an additional JSONItem to render - if that's confirmed we might rename this method.voidsetOrderable(java.lang.Boolean orderable)Sets if the edited component is orderable.voidwrite(JSONWriter out)Serializes this descriptor to json 
 - 
 
- 
- 
Constructor Detail
- 
CustomEditConfig
public CustomEditConfig(ComponentEditConfig cfg)
 
 - 
 
- 
Method Detail
- 
drawEditing
public void drawEditing(java.io.PrintWriter out, java.lang.String contentPath, java.lang.String resourceType, java.lang.String dlgPath, Cell cell, boolean isContainer) throws java.io.IOException- Throws:
 java.io.IOException
 
- 
setLayout
public void setLayout(EditLayout layout)
Description copied from interface:EditConfigSets the edit layout for the edit control widget.- Specified by:
 setLayoutin interfaceEditConfig- Parameters:
 layout- edit layout
 
- 
setInsertBehavior
public void setInsertBehavior(java.lang.String insertBehavior)
Description copied from interface:EditConfigSets the insert behavior- Specified by:
 setInsertBehaviorin interfaceEditConfig- Parameters:
 insertBehavior- the behavior
 
- 
setDialogMode
public void setDialogMode(DialogMode mode)
Description copied from interface:EditConfigSets the dialog mode- Specified by:
 setDialogModein interfaceEditConfig- Parameters:
 mode- the mode
 
- 
setInplaceEditingConfig
public void setInplaceEditingConfig(InplaceEditingConfig inplaceEditingConfig)
Description copied from interface:EditConfigSets the inplace editing configuration.- Specified by:
 setInplaceEditingConfigin interfaceEditConfig- Parameters:
 inplaceEditingConfig- The inplace editing configuration
 
- 
setEmpty
public void setEmpty(boolean empty)
Description copied from interface:EditConfigSets theemptyflag. Iftruethis indicates that the component has not visual content and a placeholder text should be rendered.- Specified by:
 setEmptyin interfaceEditConfig- Parameters:
 empty-trueif a placeholder text should be rendered.
 
- 
setEmptyText
public void setEmptyText(java.lang.String emptyText)
Description copied from interface:EditConfigSets the text to be displayed whenComponentEditConfig.isEmpty()istrue. Iftextisnullthen the default text is displayed.- Specified by:
 setEmptyTextin interfaceEditConfig- Parameters:
 emptyText- the text ornull
 
- 
setOrderable
public void setOrderable(java.lang.Boolean orderable)
Description copied from interface:EditConfigSets if the edited component is orderable.- Specified by:
 setOrderablein interfaceEditConfig- Parameters:
 orderable-trueto enable ordering ornullif the behavior is defined by the widgets.
 
- 
setDeepCancel
public void setDeepCancel(java.lang.Boolean deepCancel)
Description copied from interface:EditConfigSets if cancelling inheritance of the component sets the cq:isCancelledForChildren flag or not.- Specified by:
 setDeepCancelin interfaceEditConfig- Parameters:
 deepCancel-trueif cancel sets the flag ornullif cancel does not set the flag.
 
- 
setLiveRelationship
public void setLiveRelationship(JSONItem liveRelationship)
Description copied from interface:EditConfigSet the computed live relationship of the component TODO seems like we are only considering this as an additional JSONItem to render - if that's confirmed we might rename this method.- Specified by:
 setLiveRelationshipin interfaceEditConfig- Parameters:
 liveRelationship- the relationship to set
 
- 
isDefault
public boolean isDefault()
Description copied from interface:ComponentEditConfigChecks if this config has all default values in respect to the default values of the widgets. Iftruethe edit config does not need to be submitted to the client.- Specified by:
 isDefaultin interfaceComponentEditConfig- Returns:
 trueif default
 
- 
getLayout
public EditLayout getLayout()
Description copied from interface:ComponentEditConfigReturns the edit layout for the edit control widget.- Specified by:
 getLayoutin interfaceComponentEditConfig- Returns:
 - the edit layout for the edit control widget.
 
 
- 
getDropTargets
public java.util.Map<java.lang.String,DropTarget> getDropTargets()
Description copied from interface:EditConfigReturns amap of configurations of drop targets. the keys are the ids of the configs. Note that the map is modifiable and can be used to extend the drop targets dynamically.- Specified by:
 getDropTargetsin interfaceComponentEditConfig- Specified by:
 getDropTargetsin interfaceEditConfig- Returns:
 - map of drop target configurations.
 
 
- 
getInsertBehavior
public java.lang.String getInsertBehavior()
Description copied from interface:ComponentEditConfigReturns the insert behavior ornullof not defined- Specified by:
 getInsertBehaviorin interfaceComponentEditConfig- Returns:
 - insert behavior or 
null 
 
- 
getToolbar
public Toolbar getToolbar()
Description copied from interface:EditConfigReturns the (modifiable) toolbar for the editbar/menu.- Specified by:
 getToolbarin interfaceComponentEditConfig- Specified by:
 getToolbarin interfaceEditConfig- Returns:
 - toolbar
 
 
- 
getDialogMode
public DialogMode getDialogMode()
Description copied from interface:ComponentEditConfigReturns the display mode of the dialog- Specified by:
 getDialogModein interfaceComponentEditConfig- Returns:
 - the dialog mode.
 
 
- 
getInplaceEditingConfig
public InplaceEditingConfig getInplaceEditingConfig()
Description copied from interface:ComponentEditConfigReturns the configuration for inplace editing of this configuration.- Specified by:
 getInplaceEditingConfigin interfaceComponentEditConfig- Returns:
 - The inplace editing config; 
nullif there is no inplace editing config (which means that no inplace editing is available for the component) 
 
- 
isEmpty
public boolean isEmpty()
Description copied from interface:ComponentEditConfigReturns theemptyflag. Indicates if the respective component has no visual content and a placeholder text should be rendered.- Specified by:
 isEmptyin interfaceComponentEditConfig- Returns:
 trueif a placeholder text should be rendered
 
- 
getEmptyText
public java.lang.String getEmptyText()
Description copied from interface:ComponentEditConfigGets the text to be displayed whenComponentEditConfig.isEmpty()istrue. Returnsnullif the default text is displayed.- Specified by:
 getEmptyTextin interfaceComponentEditConfig- Returns:
 - the empty text or 
null 
 
- 
isOrderable
public java.lang.Boolean isOrderable()
Description copied from interface:ComponentEditConfigReturns if the edited component is orderable.- Specified by:
 isOrderablein interfaceComponentEditConfig- Returns:
 trueif the component is orderable ornullif the behavior is defined by the widgets.
 
- 
getFormParameters
public java.util.Map<java.lang.String,java.lang.String> getFormParameters()
Description copied from interface:EditConfigReturns a modifiable map for additional form parameters to be included in the dialog.- Specified by:
 getFormParametersin interfaceComponentEditConfig- Specified by:
 getFormParametersin interfaceEditConfig- Returns:
 - map of additional form parameters
 
 
- 
getListeners
public java.util.Map<java.lang.String,java.lang.String> getListeners()
Description copied from interface:EditConfigReturns a modifiable map of edit listeners- Specified by:
 getListenersin interfaceComponentEditConfig- Specified by:
 getListenersin interfaceEditConfig- Returns:
 - map of edit listeners
 
 
- 
getLiveRelationship
public JSONItem getLiveRelationship()
Description copied from interface:ComponentEditConfigReturns the component live relationship. TODO seems like we are only considering this as an additional JSONItem to render - if that's confirmed we might rename this method.- Specified by:
 getLiveRelationshipin interfaceComponentEditConfig- Returns:
 - the computed live relationship. 
nullotherwise 
 
- 
isDeepCancel
public java.lang.Boolean isDeepCancel()
Description copied from interface:ComponentEditConfigReturns if cancelling inheritance of the component sets the cq:isCancelledForChildren flag or not.- Specified by:
 isDeepCancelin interfaceComponentEditConfig- Returns:
 trueif cancel sets the flag ornullif cancel does not set the flag.
 
- 
isTargetingDisabled
public boolean isTargetingDisabled()
Description copied from interface:ComponentEditConfigReturns if targeting is disabled for this component.- Specified by:
 isTargetingDisabledin interfaceComponentEditConfig- Returns:
 trueif targeting is disabled,falseif targeting is allowed
 
- 
write
public void write(JSONWriter out) throws JSONException
Description copied from interface:JSONItemSerializes this descriptor to json- Specified by:
 writein interfaceJSONItem- Parameters:
 out- json writer- Throws:
 JSONException- if a JSON error occurs
 
- 
getFormParameterMap
public java.util.Map<java.lang.String,java.lang.Object> getFormParameterMap()
Description copied from interface:EditConfigReturns the additional form parameters to be included in the dialog. This method allows to use multi value properties for form parameters.- Specified by:
 getFormParameterMapin interfaceComponentEditConfig- Specified by:
 getFormParameterMapin interfaceEditConfig- Returns:
 - map of additional form parameters
 
 
 - 
 
 -