Interface ItemSelectorCriterion

All Known Implementing Classes:
BaseItemSelectorCriterion

public interface ItemSelectorCriterion
Provides an interface that determines the type of entity that shall be selected and information to return. The item selector uses the criterion to display only the ItemSelectorView that can select that particular entity type and that can support the ItemSelectorReturnType.

Implementations of this interface can hold fine-grained details about entities that can be selected. This detailed information should be specified ideally using primitive types (or using very simple types that can be JSON serialized). The implementation can set this data and make it accessible, however desired. It must, however, specify a non-parametrized constructor.

As an example, see the BlogsItemSelectorCriterion class and how BlogsContentEditorConfigContributor's populateFileBrowserURL method populates an instance of it and uses it.

For simplicity, it is recommended that implementations extend BaseItemSelectorCriterion.

  • Method Details

    • getDesiredItemSelectorReturnTypes

      List<ItemSelectorReturnType> getDesiredItemSelectorReturnTypes()
      Returns the desired return types that the caller expects and can handle, ordered by preference.

      The order of return types is important because the first return type that can be used will be used.

      Returns:
      the return types ordered by preference
    • getMimeTypeRestriction

      default String getMimeTypeRestriction()
    • setDesiredItemSelectorReturnTypes

      void setDesiredItemSelectorReturnTypes(ItemSelectorReturnType... desiredItemSelectorReturnType)
    • setDesiredItemSelectorReturnTypes

      void setDesiredItemSelectorReturnTypes(List<ItemSelectorReturnType> desiredItemSelectorReturnTypes)
      Sets a list of desired return types that the caller expects and can handle, ordered by preference.

      The order of return types is important because the first return type that can be used will be used.

      Parameters:
      desiredItemSelectorReturnTypes - a preference ordered list of the return types the caller can handle