Class A_CmsPropertyEditor

java.lang.Object
org.opencms.gwt.client.property.A_CmsPropertyEditor
All Implemented Interfaces:
I_CmsFormWidgetMultiFactory
Direct Known Subclasses:
CmsNavModePropertyEditor, CmsSimplePropertyEditor, CmsVfsModePropertyEditor

public abstract class A_CmsPropertyEditor extends Object implements I_CmsFormWidgetMultiFactory
The abstract base class for dialogs to edit properties.

Since:
8.0.0
  • Field Details

  • 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 handler
      propertyConfig - the property configuration
  • Method Details

    • checkWidgetRequirements

      public 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.

      Parameters:
      key - the widget key
      widget - 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 interface I_CmsFormWidgetMultiFactory
      Parameters:
      key - the key identifying the widget type
      widgetParams - the widget initialization parameters
      defaultValue - an optional default value
      Returns:
      the created form widget
      See Also:
    • disableInput

      public void disableInput(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(List<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.

    • createUrlNameField

      Creates the text field for editing the URL name.

      Returns:
      the newly created form field
    • getTitle

      protected String getTitle(Map<String,String> fieldValues)
      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

      protected String message(String key, 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, 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(String urlName)
      Sets the contents of the URL name field in the form.

      Parameters:
      urlName - the new URL name
    • showUrlNameError

      protected void showUrlNameError(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