Package org.opencms.gwt.client.property
Class A_CmsPropertyEditor
java.lang.Object
org.opencms.gwt.client.property.A_CmsPropertyEditor
- All Implemented Interfaces:
I_CmsFormWidgetMultiFactory
- Direct Known Subclasses:
CmsNavModePropertyEditor
,CmsSimplePropertyEditor
,CmsVfsModePropertyEditor
The abstract base class for dialogs to edit properties.
- Since:
- 8.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The field id for the link selector widget.static final String
The field id of the "url name" form field.The list of all property names.protected String
The reason to disable the form input fields.protected CmsForm
The form containing the fields.protected I_CmsPropertyEditorHandler
The handler for this sitemap entry editor.protected boolean
True if only the name edit field is disabled.The configuration of the properties.protected I_CmsFormField
The URL name field.protected CmsDefaultStringModel
The model for the URL name field. -
Constructor Summary
ConstructorsConstructorDescriptionA_CmsPropertyEditor
(Map<String, org.opencms.xml.content.CmsXmlContentProperty> propertyConfig, I_CmsPropertyEditorHandler handler) Creates a new sitemap entry editor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Method to add special, non-property fields.protected abstract void
Builds and renders the fields for the properties.static void
checkWidgetRequirements
(String key, I_CmsFormWidget widget) Checks whether a widget can be used in the sitemap entry editor, and throws an exception otherwise.createFormWidget
(String key, Map<String, String> widgetParams, com.google.common.base.Optional<String> defaultValue) Creates a new form widget.protected CmsBasicFormField
Creates the text field for editing the URL name.void
disableInput
(String disabledReason, boolean nameOnlyDisabled) Disables all input to the form.getForm()
Gets the form for the properties.protected String
Gets the title from a map of field values.protected CmsDefaultStringModel
getUrlNameModel
(String urlName) Lazily creates the model object for the URL name field.void
initializeWidgets
(CmsPopup dialog) Initializes the widgets for editing the properties.protected String
Returns a localized message from the message bundle.protected void
setGhostValue
(I_CmsFormField field, String value, boolean ghostMode) Sets the ghost value for a form field if its normal value is empty and the field's widget supports ghost values.void
setPropertyNames
(List<String> propertyNames) Sets the names of properties which can be edited.protected abstract void
Sets up the widget which will contain the input fields for the properties.protected void
setUrlNameField
(String urlName) Sets the contents of the URL name field in the form.protected void
showUrlNameError
(String message) Shows an error message next to the URL name input field.
-
Field Details
-
FIELD_LINK
The field id for the link selector widget.- See Also:
-
FIELD_URLNAME
The field id of the "url name" form field.- See Also:
-
m_allProps
The list of all property names. -
m_disabledReason
The reason to disable the form input fields. -
m_nameOnlyDisabled
True if only the name edit field is disabled. -
m_form
The form containing the fields. -
m_handler
The handler for this sitemap entry editor. -
m_propertyConfig
The configuration of the properties. -
m_urlNameField
The URL name field. -
m_urlNameModel
The model for the URL name field.
-
-
Constructor Details
-
A_CmsPropertyEditor
public A_CmsPropertyEditor(Map<String, org.opencms.xml.content.CmsXmlContentProperty> propertyConfig, I_CmsPropertyEditorHandler handler) Creates a new sitemap entry editor.- Parameters:
handler
- the handlerpropertyConfig
- the property configuration
-
-
Method Details
-
checkWidgetRequirements
Checks whether a widget can be used in the sitemap entry editor, and throws an exception otherwise.- Parameters:
key
- the widget keywidget
- the created widget
-
createFormWidget
public I_CmsFormWidget createFormWidget(String key, Map<String, String> widgetParams, com.google.common.base.Optional<String> defaultValue) Description copied from interface:I_CmsFormWidgetMultiFactory
Creates a new form widget.- Specified by:
createFormWidget
in interfaceI_CmsFormWidgetMultiFactory
- Parameters:
key
- the key identifying the widget typewidgetParams
- the widget initialization parametersdefaultValue
- an optional default value- Returns:
- the created form widget
- See Also:
-
disableInput
Disables all input to the form.- Parameters:
disabledReason
- the reason to display to the usernameOnlyDisabled
- true if only the name editing field is disabled
-
getForm
Gets the form for the properties.- Returns:
- the property form
-
initializeWidgets
Initializes the widgets for editing the properties.- Parameters:
dialog
- the dialog which the property editor is part of
-
setPropertyNames
Sets the names of properties which can be edited.- Parameters:
propertyNames
- the property names
-
addSpecialFields
Method to add special, non-property fields. -
buildFields
Builds and renders the fields for the properties. -
createUrlNameField
Creates the text field for editing the URL name.- Returns:
- the newly created form field
-
getTitle
Gets the title from a map of field values.- Parameters:
fieldValues
- the map of field values- Returns:
- the title
-
getUrlNameModel
Lazily creates the model object for the URL name field.- Parameters:
urlName
- the initial value for the URL name- Returns:
- the model object for the URL name field
-
message
Returns a localized message from the message bundle.- Parameters:
key
- the message keyargs
- the message parameters- Returns:
- the localized message
-
setGhostValue
Sets the ghost value for a form field if its normal value is empty and the field's widget supports ghost values.- Parameters:
field
- the form fieldvalue
- the ghost value to setghostMode
- if true, sets the widget to ghost mode
-
setupFieldContainer
Sets up the widget which will contain the input fields for the properties. -
setUrlNameField
Sets the contents of the URL name field in the form.- Parameters:
urlName
- the new URL name
-
showUrlNameError
Shows an error message next to the URL name input field.- Parameters:
message
- the message which should be displayed, or null if no message should be displayed
-