Class IDEEncoding


  • public final class IDEEncoding
    extends java.lang.Object
    IDEEncoding is a utility class for managing encoding information that includes user preferences from the IDE and core resources.

    This class provides all its functionality via static methods. It is not intended to be instantiated or subclassed.

    Since:
    3.1
    See Also:
    WorkbenchEncoding, ResourcesPlugin
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BOM_UTF_16BE
      Display constant for the UTF 16 big endian byte order marker for resources.
      static java.lang.String BOM_UTF_16LE
      Display constant for the UTF 16 little endian byte order marker for resources.
      static java.lang.String BOM_UTF_8
      Display constant for the UTF 8 byte order marker for resources.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addIDEEncoding​(java.lang.String value)
      Add value to the list of workbench encodings.
      static void clearUserEncodings()
      Clear the IDE encodings preference.
      static java.lang.String getByteOrderMarkLabel​(IContentDescription description)
      Get the displayable string for the byte order marking from the supplied file description.
      static java.util.List<java.lang.String> getIDEEncodings()
      Get all of the available encodings including any that were saved as a preference in the IDE or in core resources.
      static java.lang.String getResourceEncoding()
      Get the current value of the encoding preference.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • BOM_UTF_8

        public static java.lang.String BOM_UTF_8
        Display constant for the UTF 8 byte order marker for resources.
      • BOM_UTF_16BE

        public static java.lang.String BOM_UTF_16BE
        Display constant for the UTF 16 big endian byte order marker for resources.
      • BOM_UTF_16LE

        public static java.lang.String BOM_UTF_16LE
        Display constant for the UTF 16 little endian byte order marker for resources.
    • Method Detail

      • getIDEEncodings

        public static java.util.List<java.lang.String> getIDEEncodings()
        Get all of the available encodings including any that were saved as a preference in the IDE or in core resources.
        Returns:
        List of String
      • getResourceEncoding

        public static java.lang.String getResourceEncoding()
        Get the current value of the encoding preference. If the value is not set return null.
        Returns:
        String
      • addIDEEncoding

        public static void addIDEEncoding​(java.lang.String value)
        Add value to the list of workbench encodings.
        Parameters:
        value - encoding to add
      • clearUserEncodings

        public static void clearUserEncodings()
        Clear the IDE encodings preference.