Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.ui.editors.text
Class DefaultEncodingSupport

    java.lang.Object
      org.eclipse.ui.editors.text.DefaultEncodingSupport

All Implemented Interfaces:
  IEncodingSupport

public class DefaultEncodingSupport
extends Object
implements IEncodingSupport

The standard implementation of `IEncodingSupport`.

Since:
  2.0

Constructor Summary
`DefaultEncodingSupport()` Creates a new encoding support.

Method Summary
`void` | `dispose()` Disposes this encoding support.
`String` | `getDefaultEncoding()` Returns the default character encoding.
`String` | `getEncoding()` Returns the character encoding.
`String` | `getStatusBanner(IStatus status)` Returns a banner for the given status.
`String` | `getStatusHeader(IStatus status)` Returns a status header for the given status.
`String` | `getStatusMessage(IStatus status)` Returns a status message if any.
`void` | `initialize(StatusTextEditor textEditor)` Associates this encoding support to the given text editor and initializes this encoding.
`void` | `reset()` Resets this encoding support.
`void` | `setEncoding(String encoding)` Sets the character encoding.
`protected void` | `setEncoding(String encoding, boolean overwrite)` Sets the encoding of the editor's input to the given value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

### getEncoding

    public String getEncoding()

  Description copied from interface: `IEncodingSupport`
  Returns the character encoding.

  Specified by:
    `getEncoding` in interface `IEncodingSupport`
  Returns:
    the character encoding

### getDefaultEncoding

    public String getDefaultEncoding()

  Description copied from interface: `IEncodingSupport`
  Returns the default character encoding.

  Specified by:
    `getDefaultEncoding` in interface `IEncodingSupport`
  Returns:
    the default 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Eclipse Platform Release 3.0
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.