com.day.cq.wcm.core.impl.components
Class ComponentEditConfigImpl

java.lang.Object
  extended by com.day.cq.wcm.core.impl.components.ComponentEditConfigImpl
All Implemented Interfaces:
ComponentEditConfig
Direct Known Subclasses:
DefaultDesignEditConfig, DefaultEditConfig, EditConfigImpl

public class ComponentEditConfigImpl
extends Object
implements ComponentEditConfig

Implements an edit config


Field Summary
protected  DialogMode dialogMode
           
protected  Map<String,DropTarget> dropTargets
           
protected  String emptyText
           
protected  Map<String,String> formParams
           
protected  String insertBehavior
           
protected  boolean isEmpty
           
protected static String KEY_ACTIONS
           
protected static String KEY_DROP_TARGET
           
protected static String KEY_EMPTY_TEXT
           
protected static String KEY_INLINE_EDITING
           
protected static String KEY_INSERT_BEHAVIOUR
           
protected static String KEY_IS_EMPTY
           
protected static String KEY_LAYOUT
           
protected static String KEY_LISTENERS
           
protected static String KEY_ORDERABLE
           
protected static String KEY_PARAMS
           
protected static String KEY_XTYPE
           
protected  EditLayout layout
           
protected  Map<String,String> listeners
           
protected  Boolean orderable
           
protected  Toolbar toolbar
           
 
Constructor Summary
protected ComponentEditConfigImpl()
          Creates a new edit config
protected ComponentEditConfigImpl(ComponentEditConfig config)
          Creates a new edit config
 
Method Summary
protected static ComponentEditConfigImpl create(Node node)
          Creates a new editing from the given node
 DialogMode getDialogMode()
          Returns the display mode of the dialog
 Map<String,DropTarget> getDropTargets()
          Returns a unmodifiable map of configurations of drop targets.
 String getEmptyText()
          Gets the text to be displayed when ComponentEditConfig.isEmpty() is true.
 Map<String,String> getFormParameters()
          Returns an unmodifiable map for additional form parameters to be included in the dialog.
 String getInsertBehavior()
          Returns the insert behavior or null of not defined
 EditLayout getLayout()
          Returns the edit layout for the edit control widget.
 Map<String,String> getListeners()
          Returns an unmodifiable map of edit listeners.
 Toolbar getToolbar()
          Returns the (unmodifiable) toolbar for the editbar/menu.
 boolean isDefault()
          Checks if this config has all default values in respect to the default values of the widgets.
 boolean isEmpty()
          Returns the empty flag.
 Boolean isOrderable()
          Returns if the edited component is orderable.
protected  void seal()
           
 void write(org.apache.sling.commons.json.io.JSONWriter out)
          Serializes this descriptor to json
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_INSERT_BEHAVIOUR

protected static final String KEY_INSERT_BEHAVIOUR
See Also:
Constant Field Values

KEY_LISTENERS

protected static final String KEY_LISTENERS
See Also:
Constant Field Values

KEY_INLINE_EDITING

protected static final String KEY_INLINE_EDITING
See Also:
Constant Field Values

KEY_DROP_TARGET

protected static final String KEY_DROP_TARGET
See Also:
Constant Field Values

KEY_PARAMS

protected static final String KEY_PARAMS
See Also:
Constant Field Values

KEY_LAYOUT

protected static final String KEY_LAYOUT
See Also:
Constant Field Values

KEY_ACTIONS

protected static final String KEY_ACTIONS
See Also:
Constant Field Values

KEY_IS_EMPTY

protected static final String KEY_IS_EMPTY
See Also:
Constant Field Values

KEY_EMPTY_TEXT

protected static final String KEY_EMPTY_TEXT
See Also:
Constant Field Values

KEY_XTYPE

protected static final String KEY_XTYPE
See Also:
Constant Field Values

KEY_ORDERABLE

protected static final String KEY_ORDERABLE
See Also:
Constant Field Values

layout

protected EditLayout layout

dialogMode

protected DialogMode dialogMode

insertBehavior

protected String insertBehavior

isEmpty

protected boolean isEmpty

emptyText

protected String emptyText

orderable

protected Boolean orderable

toolbar

protected Toolbar toolbar

dropTargets

protected Map<String,DropTarget> dropTargets

formParams

protected Map<String,String> formParams

listeners

protected Map<String,String> listeners
Constructor Detail

ComponentEditConfigImpl

protected ComponentEditConfigImpl()
Creates a new edit config


ComponentEditConfigImpl

protected ComponentEditConfigImpl(ComponentEditConfig config)
Creates a new edit config

Parameters:
config - the base config
Method Detail

create

protected static ComponentEditConfigImpl create(Node node)
                                         throws RepositoryException
Creates a new editing from the given node

Parameters:
node - the node
Returns:
the new editing
Throws:
RepositoryException - if an error occurs

seal

protected void seal()

isDefault

public boolean isDefault()
Checks if this config has all default values in respect to the default values of the widgets. If true the edit config does not need to be submitted to the client.

Specified by:
isDefault in interface ComponentEditConfig
Returns:
true if default

getLayout

public EditLayout getLayout()
Returns the edit layout for the edit control widget.

Specified by:
getLayout in interface ComponentEditConfig
Returns:
the edit layout for the edit control widget.

getDropTargets

public Map<String,DropTarget> getDropTargets()
Returns a unmodifiable map of configurations of drop targets. the keys are the ids of the configs.

Specified by:
getDropTargets in interface ComponentEditConfig
Returns:
map of drop target configurations.

getInsertBehavior

public String getInsertBehavior()
Returns the insert behavior or null of not defined

Specified by:
getInsertBehavior in interface ComponentEditConfig
Returns:
insert behavior or null

getToolbar

public Toolbar getToolbar()
Returns the (unmodifiable) toolbar for the editbar/menu.

Specified by:
getToolbar in interface ComponentEditConfig
Returns:
toolbar

getDialogMode

public DialogMode getDialogMode()
Returns the display mode of the dialog

Specified by:
getDialogMode in interface ComponentEditConfig
Returns:
the dialog mode.

isEmpty

public boolean isEmpty()
Returns the empty flag. Indicates if the respective component has no visual content and a placeholder text should be rendered.

Specified by:
isEmpty in interface ComponentEditConfig
Returns:
true if a placeholder text should be rendered

getEmptyText

public String getEmptyText()
Gets the text to be displayed when ComponentEditConfig.isEmpty() is true. Returns null if the default text is displayed.

Specified by:
getEmptyText in interface ComponentEditConfig
Returns:
the empty text or null

isOrderable

public Boolean isOrderable()
Returns if the edited component is orderable.

Specified by:
isOrderable in interface ComponentEditConfig
Returns:
true if the component is orderable or null if the behavior is defined by the widgets.

getFormParameters

public Map<String,String> getFormParameters()
Returns an unmodifiable map for additional form parameters to be included in the dialog.

Specified by:
getFormParameters in interface ComponentEditConfig
Returns:
map of additional form parameters

getListeners

public Map<String,String> getListeners()
Returns an unmodifiable map of edit listeners.

Specified by:
getListeners in interface ComponentEditConfig
Returns:
map of edit listeners

write

public void write(org.apache.sling.commons.json.io.JSONWriter out)
           throws org.apache.sling.commons.json.JSONException
Serializes this descriptor to json

Specified by:
write in interface ComponentEditConfig
Parameters:
out - json writer
Throws:
org.apache.sling.commons.json.JSONException - if a JSON error occurs


Copyright © 2008 Day Management AG. All Rights Reserved.