com.hipipal.texteditor.undo
Class TextChangeDelete

java.lang.Object
  extended by com.hipipal.texteditor.undo.TextChangeDelete
All Implemented Interfaces:
Constants, TextChange

public class TextChangeDelete
extends java.lang.Object
implements TextChange


Field Summary
 
Fields inherited from interface com.hipipal.texteditor.common.Constants
ACTION_WIDGET_OPEN, BACKUP_FILE_NAME, COLOR_CLASSIC, COLOR_DRACULA, COLOR_MATRIX, COLOR_NEGATIVE, COLOR_SKY, ENC_ASCII, ENC_LATIN, ENC_UTF8, EOL_LINUX, EOL_MAC, EOL_WINDOWS, EXTRA_FORCE_READ_ONLY, EXTRA_REQUEST_CODE, FONT_FILE_NAME, FONT_FOLDER_NAME, MENU_ID_ABOUT, MENU_ID_NEW, MENU_ID_OPEN, MENU_ID_OPEN_RECENT, MENU_ID_QUIT, MENU_ID_REDO, MENU_ID_SAVE, MENU_ID_SAVE_AS, MENU_ID_SEARCH, MENU_ID_SETTINGS, MENU_ID_UNDO, PREFERENCE_ALLOW_UNDO, PREFERENCE_AUTO_SAVE, PREFERENCE_AUTO_SAVE_OVERWRITE, PREFERENCE_BACK_BUTTON_AS_UNDO, PREFERENCE_COLOR_THEME, PREFERENCE_ENCODING, PREFERENCE_END_OF_LINES, PREFERENCE_FLING_TO_SCROLL, PREFERENCE_FONT, PREFERENCE_HIGHLIGHT, PREFERENCE_HOME_PAGE_PATH, PREFERENCE_MAX_RECENTS, PREFERENCE_MAX_UNDO_STACK, PREFERENCE_RECENTS, PREFERENCE_SEARCH_MATCH_CASE, PREFERENCE_SEARCHWRAP, PREFERENCE_SELECT_FONT, PREFERENCE_SHOW_LINE_NUMBERS, PREFERENCE_TEXT_SIZE, PREFERENCE_USE_HOME_PAGE, PREFERENCE_WORDWRAP, PREFERENCES_NAME, REQUEST_FONT, REQUEST_HOME_PAGE, REQUEST_OPEN, REQUEST_RECENT, REQUEST_SAVE_AS, RESULT_ERROR, STORAGE, STORAGE_PATH, TAG, TEXT_SIZE_MAX, TEXT_SIZE_MIN
 
Constructor Summary
TextChangeDelete(java.lang.CharSequence seq, int start)
           
 
Method Summary
 void append(java.lang.CharSequence seq)
          Method is deprecated, you should use the canMergeXXX methods instead
 boolean canMergeChangeAfter(java.lang.CharSequence s, int start, int before, int count)
          A change to the text s has been made, where the count characters starting at start have replaced the substring of length before If possible, this change is merged in this TextChange
 boolean canMergeChangeBefore(java.lang.CharSequence s, int start, int count, int after)
          A change to the text s will be made, where the count characters starting at start will be replaced by after characters If possible, this change is merged in this TextChange
 int getCaret()
          Method is deprecated, you should use the canMergeXXX methods instead
 java.lang.String toString()
           
 int undo(android.text.Editable s)
          Undo this change
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextChangeDelete

public TextChangeDelete(java.lang.CharSequence seq,
                        int start)
Parameters:
seq - the sequence being deleted
start - the start index
Method Detail

undo

public int undo(android.text.Editable s)
Description copied from interface: TextChange
Undo this change

Specified by:
undo in interface TextChange
Parameters:
s - the editable object on which the undo is done
Returns:
the caret position after the undo
See Also:
TextChange.undo(android.text.Editable)

getCaret

public int getCaret()
Description copied from interface: TextChange
Method is deprecated, you should use the canMergeXXX methods instead

Specified by:
getCaret in interface TextChange
Returns:
the caret position after this change
See Also:
TextChange.getCaret()

append

public void append(java.lang.CharSequence seq)
Description copied from interface: TextChange
Method is deprecated, you should use the canMergeXXX methods instead

Specified by:
append in interface TextChange
Parameters:
seq - the sequence being appended to this TextChange
See Also:
TextChange.append(java.lang.CharSequence)

canMergeChangeBefore

public boolean canMergeChangeBefore(java.lang.CharSequence s,
                                    int start,
                                    int count,
                                    int after)
Description copied from interface: TextChange
A change to the text s will be made, where the count characters starting at start will be replaced by after characters If possible, this change is merged in this TextChange

Specified by:
canMergeChangeBefore in interface TextChange
Parameters:
s - the sequence being changed
start - the start index
count - the number of characters that will change
after - the number of characters that will replace the old ones
Returns:
if the change can be merged with this TextChange
See Also:
TextChange.canMergeChangeAfter(java.lang.CharSequence, int, int, int)

canMergeChangeAfter

public boolean canMergeChangeAfter(java.lang.CharSequence s,
                                   int start,
                                   int before,
                                   int count)
Description copied from interface: TextChange
A change to the text s has been made, where the count characters starting at start have replaced the substring of length before If possible, this change is merged in this TextChange

Specified by:
canMergeChangeAfter in interface TextChange
Parameters:
s - the sequence being changed
start - the start index
before - the number of character that were replaced
count - the number of characters that will change
Returns:
if the change can be merged with this TextChange
See Also:
TextChange.canMergeChangeBefore(java.lang.CharSequence, int, int, int)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()