com.hipipal.texteditor.common
Class RecentFiles

java.lang.Object
  extended by com.hipipal.texteditor.common.RecentFiles
All Implemented Interfaces:
Constants

public class RecentFiles
extends java.lang.Object
implements Constants

Storage for a recent files list TODO code review


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
RecentFiles()
           
 
Method Summary
static java.util.ArrayList<java.lang.String> getRecentFiles()
           
static void loadRecentFiles(java.lang.String saved)
          loads the recent files from shared preferences
static void removePath(java.lang.String path)
          Removes a path from the recent files list
static void saveRecentList(android.content.SharedPreferences prefs)
          Saves the preferences when they have been edited
static void updateRecentList(java.lang.String path)
          Updates the recent list with a path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecentFiles

public RecentFiles()
Method Detail

loadRecentFiles

public static void loadRecentFiles(java.lang.String saved)
loads the recent files from shared preferences

Parameters:
saved - the previously saved string

saveRecentList

public static void saveRecentList(android.content.SharedPreferences prefs)
Saves the preferences when they have been edited

Parameters:
prefs - the preferences to save to

getRecentFiles

public static java.util.ArrayList<java.lang.String> getRecentFiles()
Returns:
the list of most recent files

updateRecentList

public static void updateRecentList(java.lang.String path)
Updates the recent list with a path. If the path is already in the list, bring it back to top, else add it.

Parameters:
path - the path to insert

removePath

public static void removePath(java.lang.String path)
Removes a path from the recent files list

Parameters:
path - the path to remove