Class DefaultSimpleReferenceSelectorModel

All Implemented Interfaces:
SimpleReferenceSelectorModel, SimpleSelectorModel
Direct Known Subclasses:
DefaultSimpleMediaReferenceSelectorModel

public class DefaultSimpleReferenceSelectorModel extends AbstractSimpleReferenceSelectorModel
Represents default model for simple reference selector component
  • Field Details

  • Constructor Details

    • DefaultSimpleReferenceSelectorModel

      public DefaultSimpleReferenceSelectorModel()
    • DefaultSimpleReferenceSelectorModel

      public DefaultSimpleReferenceSelectorModel(ObjectType rootType)
  • Method Details

    • setParameters

      public void setParameters(Map<String,? extends Object> parameters)
    • getParameters

      public Map<String,? extends Object> getParameters()
    • getPageSize

      public int getPageSize()
      Description copied from interface: SimpleReferenceSelectorModel
      Returns page size
      Returns:
      - page size
    • getAutoCompleteResult

      public List<? extends Object> getAutoCompleteResult()
      Description copied from interface: SimpleReferenceSelectorModel
      Returns current auto complete results
      Returns:
      auto complete results
    • getValue

      public Object getValue()
      Description copied from interface: SimpleSelectorModel
      Retrieve current value
      Returns:
      current value
    • getMinAutoCompleteTextLength

      public int getMinAutoCompleteTextLength()
      Description copied from interface: SimpleReferenceSelectorModel
      After how many characters auto complete results should be triggered
      Returns:
      characters quantity
    • getMaxAutoCompleteResultSize

      public int getMaxAutoCompleteResultSize()
    • getMode

      public SimpleSelectorModel.Mode getMode()
      Description copied from interface: SimpleSelectorModel
      Retrieve current mode
      Returns:
      current mode
    • getSearchResult

      public List<? extends Object> getSearchResult()
      Description copied from interface: SimpleReferenceSelectorModel
      Returns current search results - used for advanced search selector mode
      Returns:
      search results
    • getTotalSize

      public int getTotalSize()
      Description copied from interface: SimpleReferenceSelectorModel
      Returns total size of search results
      Returns:
      total size
    • getAdvancedSearchModel

      public AdvancedSearchModel getAdvancedSearchModel()
      Description copied from interface: SimpleReferenceSelectorModel
      Returns advanced search mode - used for advanced mode
      Returns:
      advanced search model
    • getRootType

      public ObjectType getRootType()
      Description copied from interface: SimpleReferenceSelectorModel
      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 SimpleReferenceSelectorModel.getRootSearchType(). In this case information about the root type is generally needed for value handling.

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

      public ObjectType getRootSearchType()
      Description copied from interface: SimpleReferenceSelectorModel
      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 SimpleReferenceSelectorModel.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:
    • getAutocompleteSearchType

      public ObjectType getAutocompleteSearchType()
    • getTableModel

      public MutableTableModel getTableModel()
      Description copied from interface: SimpleReferenceSelectorModel
      Returns current table model - used in advanced mode
      Returns:
      root search type
    • cancel

      public void cancel()
      Description copied from interface: SimpleReferenceSelectorModel
      Perform cancel on simple reference selector model
    • doSearch

      public void doSearch(ObjectTemplate objectType, AdvancedSearchParameterContainer parameterContainer, int currentPage)
      Description copied from interface: SimpleReferenceSelectorModel
      Perform search within advanced selector mode
      Parameters:
      objectType - - chosen type
      parameterContainer - - parameters
      currentPage - - current page
    • createAdvancedTableModel

      public DefaultAdvancedSearchModel createAdvancedTableModel()
      Description copied from interface: SimpleReferenceSelectorModel
      Creates advanced table model - used for advanced mode
      Returns:
      advanced table model
    • createDefaultTableModel

      public MutableTableModel createDefaultTableModel()
      Description copied from interface: SimpleReferenceSelectorModel
      Creates an default table model - used for advanced mode
      Returns:
      default table model
    • setValue

      public void setValue(Object value)
      Sets current value
      Parameters:
      value - the value to set
    • setMode

      public void setMode(SimpleSelectorModel.Mode mode)
      Sets current model
      Parameters:
      mode - current model
    • setAutoCompleteResult

      public void setAutoCompleteResult(List<? extends Object> autoCompleteResult)
      Sets auto complete results
      Parameters:
      autoCompleteResult - - auto complete results
    • setSearchResult

      public void setSearchResult(List<? extends Object> searchResult)
      Sets search results
      Parameters:
      searchResult - - search results
    • setMinAutoCompleteTextLength

      public void setMinAutoCompleteTextLength(int minAutoCompleteTextLength)
    • setMaxAutoCompleteResultSize

      public void setMaxAutoCompleteResultSize(int maxAutoCompleteResultSize)
    • setPageSize

      public void setPageSize(int pageSize)
    • setTotalSize

      public void setTotalSize(int totalSize)
    • getTypeService

      public TypeService getTypeService()
      Retrieves cockpit type service
      Returns:
      cockpit type service
    • getSearchProvider

      protected SearchProvider getSearchProvider()
      Retrieves search provider
      Returns:
      search provider
    • setRootType

      public void setRootType(ObjectType rootType)
      Sets the root type of this reference selector i.e. the type of the items which this editor holds references to.

      Note: Unless search type has been set explicitly, getRootSearchType() will return the same type as getRootType().

      Parameters:
      rootType - reference type
      See Also:
    • setRootSearchType

      public void setRootSearchType(ObjectType rootSearchType)
      Sets the type for which this reference selector should search for. If rootSearchType is null getRootSearchType() will return the same type as getRootType().
      Parameters:
      rootSearchType - the type of the items to search for
      See Also:
    • setAutocompleteSearchType

      public void setAutocompleteSearchType(ObjectType autocompletionSearchType)
    • saveItem

      public void saveItem(Object currentValue)
      Performs save item
      Parameters:
      currentValue - - current value