Interface Editor<T,​A>

  • Type Parameters:
    T - The edited entity type.
    A - The edited member type for this editor/sub-editor.
    All Superinterfaces:
    Viewer<T>
    All Known Subinterfaces:
    GroupEditor, RoleEditor, UserAssignedGroupsEditor, UserAssignedGroupsExplorer, UserAssignedRolesEditor, UserAssignedRolesExplorer, UserAttributesEditor, UserEditor

    public interface Editor<T,​A>
    extends Viewer<T>

    A client side editor.

    Editors should implement this interface in order to isolate the editor components from the editing logic (provided by drivers) and the instance edited.

    Editor sub-types should add more interface methods to describe the whole editor hierarchy for the instance of type T.

    The most common edition workflow consist of:

    1. Create the editor implementation instance and call edit() using the edited instance as argument.
    2. Let the user interact with the editors and update their states.
    3. Flush the whole editors hierarchy to ensure editor's states are up to date.
    4. Obtain the edited instance member values from each editor in the hierarchy by calling getValue().
    5. Validate the edited instance using any JSR303 validators for it.
    6. Set the resulting violations, if any, into the editors hierarchy to display the validation errors.
    Since:
    0.8.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void edit​(T instance)
      Initialize the editor hierarchy using the instance given.
      void flush()
      Flush editor's state.
      A getValue()
      Get edited value.
      void setViolations​(Set<javax.validation.ConstraintViolation<T>> violations)
      Set validation violations into the editor hierarchy.
      • Methods inherited from interface org.uberfire.ext.security.management.client.editor.Viewer

        show
    • Method Detail

      • edit

        void edit​(T instance)
        Initialize the editor hierarchy using the instance given.
        Parameters:
        instance - The instance used to initialize editors.
      • flush

        void flush()
        Flush editor's state.
      • getValue

        A getValue()
        Get edited value. This method must be called after flush.
        Returns:
      • setViolations

        void setViolations​(Set<javax.validation.ConstraintViolation<T>> violations)
        Set validation violations into the editor hierarchy.
        Parameters:
        violations - The validation violations.