Class CharsetHelper


  • public class CharsetHelper
    extends Object
    Helper class for charset setup.
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the helper.
      • isModified

        public boolean isModified()
        Whether the settings got modified.
        Returns:
        true if modified
      • getCharset

        public Charset getCharset()
        Returns the charset.
        Returns:
        the charset
      • setCharset

        public void setCharset​(Charset value)
        Updates the charset.
        Parameters:
        value - the charset
      • setCharset

        public void setCharset​(String value)
        Updates the charset.
        Parameters:
        value - the charset
      • reload

        public void reload()
        Reloads the properties file. Discards any unsaved settings.
      • save

        public boolean save()
        Saves the settings in the user's home directory.
        Returns:
        true if successfully saved
      • getSingleton

        public static CharsetHelper getSingleton()
        Returns the singleton.
        Returns:
        the singleton
      • toString

        public static String toString​(Charset l)
        Returns the charset as string.
        Parameters:
        l - the charset object to convert
        Returns:
        the generated string
      • valueOf

        public static Charset valueOf​(String str)
        Returns a charset generated from the string (eg en, en_US). In case of CHARSET_DEFAULT, getCharset() is used.
        Parameters:
        str - the string to convert to a charset
        Returns:
        the generated charset
      • getIDs

        public static String[] getIDs()
        Returns all the charset IDs, including CHARSET_DEFAULT.
        Returns:
        the IDs