Class DefaultEncodingSupport

    • Constructor Detail

      • DefaultEncodingSupport

        public DefaultEncodingSupport()
        Creates a new encoding support.
    • Method Detail

      • initialize

        public void initialize​(StatusTextEditor textEditor)
        Associates this encoding support to the given text editor and initializes this encoding.
        Parameters:
        textEditor - the editor
      • dispose

        public void dispose()
        Disposes this encoding support.
      • reset

        public void reset()
        Resets this encoding support. Should be called if, e.g., the input element of the associated editor changed.
      • setEncoding

        protected void setEncoding​(String encoding,
                                   boolean overwrite)
        Sets the encoding of the editor's input to the given value. If overwrite is true the value is set even if the encoding is already set.
        Parameters:
        encoding - the new encoding
        overwrite - true if current encoding should be overwritten
      • setEncoding

        public void setEncoding​(String encoding)
        Description copied from interface: IEncodingSupport
        Sets the character encoding.
        Specified by:
        setEncoding in interface IEncodingSupport
        Parameters:
        encoding - the character encoding
      • getStatusHeader

        public String getStatusHeader​(IStatus status)
        Returns a status header for the given status.
        Parameters:
        status - the status
        Returns:
        a status header for the given status.
      • getStatusBanner

        public String getStatusBanner​(IStatus status)
        Returns a banner for the given status.
        Parameters:
        status - the status
        Returns:
        a banner for the given status.
      • getStatusMessage

        public String getStatusMessage​(IStatus status)
        Returns a status message if any.
        Parameters:
        status - the status
        Returns:
        a status message indicating encoding problems or null otherwise
      • isEncodingError

        public boolean isEncodingError​(IStatus status)
        Returns true if the given status is an encoding error.
        Parameters:
        status - the status to check
        Returns:
        true if the given status is an encoding error
        Since:
        3.1
      • createStatusEncodingChangeControl

        public void createStatusEncodingChangeControl​(Composite parent,
                                                      IStatus status)
        Creates the control which allows to change the encoding. In case of encoding errors this control will be placed below the status of the status editor.
        Parameters:
        parent - the parent control
        status - the status
        Since:
        3.1