public class DefaultEncodingSupport extends Object implements IEncodingSupport
IEncodingSupport.| Constructor and Description |
|---|
DefaultEncodingSupport()
Creates a new encoding support.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createStatusEncodingChangeControl(Composite parent,
IStatus status)
Creates the control which allows to change the encoding.
|
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.
|
boolean |
isEncodingError(IStatus status)
Returns
true if the given status is an
encoding error. |
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.
|
public DefaultEncodingSupport()
public void initialize(StatusTextEditor textEditor)
textEditor - the editorpublic void dispose()
public void reset()
protected void setEncoding(String encoding, boolean overwrite)
overwrite is
true the value is set even if the encoding is already set.encoding - the new encodingoverwrite - true if current encoding should be overwrittenpublic void setEncoding(String encoding)
IEncodingSupportsetEncoding in interface IEncodingSupportencoding - the character encodingpublic String getEncoding()
IEncodingSupportgetEncoding in interface IEncodingSupportpublic String getDefaultEncoding()
IEncodingSupportgetDefaultEncoding in interface IEncodingSupportpublic String getStatusHeader(IStatus status)
status - the statuspublic String getStatusBanner(IStatus status)
status - the statuspublic String getStatusMessage(IStatus status)
status - the statusnull otherwisepublic boolean isEncodingError(IStatus status)
true if the given status is an
encoding error.status - the status to checktrue if the given status is an encoding errorpublic void createStatusEncodingChangeControl(Composite parent, IStatus status)
parent - the parent controlstatus - the statusGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.