# Interface SyTextSelectionServiceType

All Superinterfaces:
  `com.io7m.repetoir.core.RPServiceType, SyServiceType`

public interface SyTextSelectionServiceType extends SyServiceType

The text selection service.

The text selection service tracks the selected text on a given screen.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Interface
  Description
  `static final record`
  `SyTextSelectionServiceType.SyTextSelectionIsSelected`
  A piece of text is selected in the given component.
  `static enum`
  `SyTextSelectionServiceType.SyTextSelectionNotSelected`
  No text is selected.
  `static interface`
  `SyTextSelectionServiceType.SyTextSelectionStatusType`
  The type of component-owned text selections

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SyTextSelectionServiceType.SyTextSelectionStatusType`
  `isComponentSelected(SyComponentReadableType component)`
  Determine if the given component has text selected.
  `void`
  `selectionClear()`
  Clear the screen's current text selection.
  `default boolean`
  `selectionClearIfComponentSelected(SyComponentReadableType component)`
  Clear the selection if the given component is the component that has text selected.
  `void`
  `selectionSet(SyComponentReadableType component, SyTextSelection selection)`
  Set the screen's current text selection, stating that `selection` is owned by the given `component`.

  ### Methods inherited from interface com.io7m.repetoir.core.RPServiceType

  `description`

- ## Method Details

  - ### selectionClear

    void selectionClear()
    Clear the screen's current text selection.

  - ### selectionSet

    void selectionSet(SyComponentReadableType component, SyTextSelection selection)
    Set the screen's current text selection, stating that `selection` is owned by the given `component`.
    Parameters:
      `component` - The component that owns the selection
      `selection` - The selection

  - ### isComponentSelected

    SyTextSelectionServiceType.SyTextSelectionStatusType isComponentSelected(SyComponentReadableType component)
    Determine if the given component has text selected.
    Parameters:
      `component` - The component
    Returns:
      The selection status

  - ### selectionClearIfComponentSelected

    default boolean selectionClearIfComponentSelected(SyComponentReadableType component)
    Clear the selection if the given component is the component that has text selected.
    Parameters:
      `component` - The component
    Returns:
      `true` if a selection was cleared