a_vcard.android.text
Class Selection

java.lang.Object
  extended by a_vcard.android.text.Selection

public class Selection
extends java.lang.Object

Utility class for manipulating cursors and selections in CharSequences. A cursor is a selection where the start and end are at the same offset.


Field Summary
static java.lang.Object SELECTION_END
           
static java.lang.Object SELECTION_START
           
 
Method Summary
static void extendSelection(Spannable text, int index)
          Move the selection edge to offset index.
static int getSelectionEnd(java.lang.CharSequence text)
          Return the offset of the selection edge or cursor, or -1 if there is no selection or cursor.
static int getSelectionStart(java.lang.CharSequence text)
          Return the offset of the selection anchor or cursor, or -1 if there is no selection or cursor.
static void removeSelection(Spannable text)
          Remove the selection or cursor, if any, from the text.
static void selectAll(Spannable text)
          Select the entire text.
static void setSelection(Spannable text, int index)
          Move the cursor to offset index.
static void setSelection(Spannable text, int start, int stop)
          Set the selection anchor to start and the selection edge to stop.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SELECTION_START

public static final java.lang.Object SELECTION_START

SELECTION_END

public static final java.lang.Object SELECTION_END
Method Detail

getSelectionStart

public static final int getSelectionStart(java.lang.CharSequence text)
Return the offset of the selection anchor or cursor, or -1 if there is no selection or cursor.


getSelectionEnd

public static final int getSelectionEnd(java.lang.CharSequence text)
Return the offset of the selection edge or cursor, or -1 if there is no selection or cursor.


setSelection

public static void setSelection(Spannable text,
                                int start,
                                int stop)
Set the selection anchor to start and the selection edge to stop.


setSelection

public static final void setSelection(Spannable text,
                                      int index)
Move the cursor to offset index.


selectAll

public static final void selectAll(Spannable text)
Select the entire text.


extendSelection

public static final void extendSelection(Spannable text,
                                         int index)
Move the selection edge to offset index.


removeSelection

public static final void removeSelection(Spannable text)
Remove the selection or cursor, if any, from the text.