Interface IControlContentAdapter2

All Known Implementing Classes:
ComboContentAdapter, TextContentAdapter

public interface IControlContentAdapter2
This interface is used by a ContentProposalAdapter in order to retrieve and set the selection range in a control.
Since:
3.4
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the current selection range in the control.
    void
    setSelection(Control control, Point range)
    Set the current selection range in the control.
  • Method Details

    • getSelection

      Point getSelection(Control control)
      Get the current selection range in the control. The x coordinate of the returned point is the position of the first selected character and the y coordinate of the returned point is the position of the last selected character. The positions are specified as a zero-based index into the string. Valid ranges are from 0 to N, where N is the size of the contents string. A value of N indicates that the last character is in the selection.
      Parameters:
      control - the control whose position is to be retrieved.
      Returns:
      a point representing the selection start and end
    • setSelection

      void setSelection(Control control, Point range)
      Set the current selection range in the control. The x coordinate of the provided point is the position of the first selected character and the y coordinate of the point is the position of the last selected character. The positions are specified as a zero-based index into the string. Valid ranges are from 0 to N, where N is the size of the contents string. A value of N indicates that the last character is in the selection. If the x and y coordinates are the same, then there is no selection.
      Parameters:
      control - the control whose position is to be retrieved.
      range - a point representing the selection start and end