All Implemented Interfaces:
ReferenceUIEditor, UIEditor
Direct Known Subclasses:
CollectionUIEditorMedia

public class CollectionUIEditor extends AbstractReferenceUIEditor
Simplistic Reference Collection Editor.

Note:
User now is able to select some values directly from auto completed list using both mouse and keyboard - this caused that this component is more intuitive an user-friendly.

  • Field Details

  • Constructor Details

    • CollectionUIEditor

      public CollectionUIEditor()
    • CollectionUIEditor

      public CollectionUIEditor(ObjectType rootType)
  • Method Details

    • setRootType

      public void setRootType(ObjectType rootType)
      Description copied from interface: ReferenceUIEditor
      Sets the root type of this reference editor i.e. the root type of the references which this editor holds.
      Parameters:
      rootType - the root type
    • setRootSearchType

      public void setRootSearchType(ObjectType rootSearchType)
      Description copied from interface: ReferenceUIEditor
      Sets the type for which this reference selector should search for.

      Note: Generally, if rootSearchType is null, the set root type will be used.

      See Also:
    • createViewComponent

      public org.zkoss.zk.ui.HtmlBasedComponent createViewComponent(Object initialValue, Map<String,? extends Object> parameters, EditorListener listener)
      Description copied from interface: UIEditor
      Creates a new editor component and attaches it to the specified Page page.
      Parameters:
      initialValue - editor's initial value
      parameters - parameters passed via configuration for particular editor
      listener - the EditorListener that will receive events when the editor's value is changed
      Returns:
      the editor component
    • registerEventListeners

      protected void registerEventListeners(AbstractUIEditor.CancelButtonContainer cancelButtonContainer)
      Registers all necessary event listeners in order to correct serve selectors events.

      Parameters:
      cancelButtonContainer - wrapped editor
    • getValue

      public Object getValue()
      Description copied from interface: UIEditor
      Returns the value held by this editor.
      Specified by:
      getValue in interface UIEditor
      Overrides:
      getValue in class AbstractUIEditor
      Returns:
      this editor's value
    • isInline

      public boolean isInline()
      Description copied from interface: UIEditor
      Returns whether this editor is an inline editor or not.
      Returns:
      true, if inline
    • setValue

      public void setValue(Object value)
      Description copied from interface: UIEditor
      Sets the value of this editor to value.

      Note: Does not have anything to do with value persistence, it is only for setting the value to be displayed. However, depending on the view component implementation and the specified EditorListener the underlying view component might generate an event which causes the EditorListener.valueChanged(Object) method to be called.

      Specified by:
      setValue in interface UIEditor
      Overrides:
      setValue in class AbstractUIEditor
      Parameters:
      value - the value to set
    • getRootSearchType

      public ObjectType getRootSearchType()
      Description copied from interface: ReferenceUIEditor
      Returns the type for which this reference collection editor should search for.

      Generally, if no root search type has been explicitly set, this method returns the same type as ReferenceUIEditor.getRootType().

      Note: The root search type is actually the type of the items held by this editor, whereas root type is the type which should be used for persisting values.
      Returns:
      the type for which this reference collection editor should search for
      See Also:
    • getRootType

      public ObjectType getRootType()
      Description copied from interface: ReferenceUIEditor
      Returns the root type of this reference collection editor i.e. the type of the items which this editor should hold references to.

      Note: If the root search type differs from the root type, this editor will actually hold items of the type returned by ReferenceUIEditor.getRootSearchType(). In this case information about the root type is generally needed for value handling.

      Returns:
      the root type of this editor
      See Also:
    • getModel

      protected DefaultCollectionEditorModel getModel()
    • assignedPassedValue

      protected void assignedPassedValue(Object initialValue)
      Assigns an initialValue as a editor value.

      Parameters:
      initialValue - editor's current initial value
    • createCollectionEditor

      public CollectionEditor createCollectionEditor(EditorListener listener, AdditionalReferenceEditorListener additionalListener)