Class A_CmsPropertyEditor

    • Constructor Summary

      Constructors 
      Constructor Description
      A_CmsPropertyEditor​(java.util.Map<java.lang.String,​org.opencms.xml.content.CmsXmlContentProperty> propertyConfig, I_CmsPropertyEditorHandler handler)
      Creates a new sitemap entry editor.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addSpecialFields()
      Method to add special, non-property fields.
      protected abstract void buildFields()
      Builds and renders the fields for the properties.
      static void checkWidgetRequirements​(java.lang.String key, I_CmsFormWidget widget)
      Checks whether a widget can be used in the sitemap entry editor, and throws an exception otherwise.
      I_CmsFormWidget createFormWidget​(java.lang.String key, java.util.Map<java.lang.String,​java.lang.String> widgetParams, com.google.common.base.Optional<java.lang.String> defaultValue)
      Creates a new form widget.
      protected CmsBasicFormField createUrlNameField()
      Creates the text field for editing the URL name.
      void disableInput​(java.lang.String disabledReason, boolean nameOnlyDisabled)
      Disables all input to the form.
      CmsForm getForm()
      Gets the form for the properties.
      protected java.lang.String getTitle​(java.util.Map<java.lang.String,​java.lang.String> fieldValues)
      Gets the title from a map of field values.
      protected CmsDefaultStringModel getUrlNameModel​(java.lang.String urlName)
      Lazily creates the model object for the URL name field.
      void initializeWidgets​(CmsPopup dialog)
      Initializes the widgets for editing the properties.
      protected java.lang.String message​(java.lang.String key, java.lang.Object... args)
      Returns a localized message from the message bundle.
      protected void setGhostValue​(I_CmsFormField field, java.lang.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​(java.util.List<java.lang.String> propertyNames)
      Sets the names of properties which can be edited.
      protected abstract void setupFieldContainer()
      Sets up the widget which will contain the input fields for the properties.
      protected void setUrlNameField​(java.lang.String urlName)
      Sets the contents of the URL name field in the form.
      protected void showUrlNameError​(java.lang.String message)
      Shows an error message next to the URL name input field.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • A_CmsPropertyEditor

        public A_CmsPropertyEditor​(java.util.Map<java.lang.String,​org.opencms.xml.content.CmsXmlContentProperty> propertyConfig,
                                   I_CmsPropertyEditorHandler handler)
        Creates a new sitemap entry editor.

        Parameters:
        handler - the handler
        propertyConfig - the property configuration
    • Method Detail

      • checkWidgetRequirements

        public static void checkWidgetRequirements​(java.lang.String key,
                                                   I_CmsFormWidget widget)
        Checks whether a widget can be used in the sitemap entry editor, and throws an exception otherwise.

        Parameters:
        key - the widget key
        widget - the created widget
      • disableInput

        public void disableInput​(java.lang.String disabledReason,
                                 boolean nameOnlyDisabled)
        Disables all input to the form.

        Parameters:
        disabledReason - the reason to display to the user
        nameOnlyDisabled - true if only the name editing field is disabled
      • getForm

        public CmsForm getForm()
        Gets the form for the properties.

        Returns:
        the property form
      • initializeWidgets

        public void initializeWidgets​(CmsPopup dialog)
        Initializes the widgets for editing the properties.

        Parameters:
        dialog - the dialog which the property editor is part of
      • setPropertyNames

        public void setPropertyNames​(java.util.List<java.lang.String> propertyNames)
        Sets the names of properties which can be edited.

        Parameters:
        propertyNames - the property names
      • addSpecialFields

        protected void addSpecialFields()
        Method to add special, non-property fields.

      • buildFields

        protected abstract void buildFields()
        Builds and renders the fields for the properties.

      • getTitle

        protected java.lang.String getTitle​(java.util.Map<java.lang.String,​java.lang.String> fieldValues)
        Gets the title from a map of field values.

        Parameters:
        fieldValues - the map of field values
        Returns:
        the title
      • getUrlNameModel

        protected CmsDefaultStringModel getUrlNameModel​(java.lang.String urlName)
        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

        protected java.lang.String message​(java.lang.String key,
                                           java.lang.Object... args)
        Returns a localized message from the message bundle.

        Parameters:
        key - the message key
        args - the message parameters
        Returns:
        the localized message
      • setGhostValue

        protected void setGhostValue​(I_CmsFormField field,
                                     java.lang.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.

        Parameters:
        field - the form field
        value - the ghost value to set
        ghostMode - if true, sets the widget to ghost mode
      • setupFieldContainer

        protected abstract void setupFieldContainer()
        Sets up the widget which will contain the input fields for the properties.

      • setUrlNameField

        protected void setUrlNameField​(java.lang.String urlName)
        Sets the contents of the URL name field in the form.

        Parameters:
        urlName - the new URL name
      • showUrlNameError

        protected void showUrlNameError​(java.lang.String message)
        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