com.hipipal.texteditor.undo
Interface TextChange

All Superinterfaces:
Constants
All Known Implementing Classes:
TextChangeDelete, TextChangeInsert

public interface TextChange
extends Constants


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
 
Method Summary
 void append(java.lang.CharSequence sequence)
          Deprecated. 
 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()
          Deprecated. 
 int undo(android.text.Editable text)
          Undo this change
 

Method Detail

undo

int undo(android.text.Editable text)
Undo this change

Parameters:
text - the editable object on which the undo is done
Returns:
the caret position after the undo

getCaret

@Deprecated
int getCaret()
Deprecated. 

Method is deprecated, you should use the canMergeXXX methods instead

Returns:
the caret position after this change

append

@Deprecated
void append(java.lang.CharSequence sequence)
Deprecated. 

Method is deprecated, you should use the canMergeXXX methods instead

Parameters:
sequence - the sequence being appended to this TextChange

canMergeChangeBefore

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

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

canMergeChangeAfter

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

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