Interface IControlContentAdapter2

    • Method Detail

      • 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