use of org.eclipse.wst.sse.core.internal.encoding.EncodingMemento in project webtools.sourceediting by eclipse.
the class CSSResourceEncodingDetector method handleSpecDefault.
private void handleSpecDefault() {
String encodingName;
encodingName = getSpecDefaultEncoding();
if (encodingName != null) {
// createEncodingMemento(encodingName,
// EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
fEncodingMemento = new EncodingMemento();
fEncodingMemento.setJavaCharsetName(encodingName);
fEncodingMemento.setAppropriateDefault(encodingName);
}
}
use of org.eclipse.wst.sse.core.internal.encoding.EncodingMemento in project webtools.sourceediting by eclipse.
the class TestStructuredDocument method testGetEncodingMemento.
public void testGetEncodingMemento() throws IOException, CoreException {
IStructuredModel model = getTestModel();
try {
IStructuredDocument sDoc = null;
sDoc = model.getStructuredDocument();
EncodingMemento memento = sDoc.getEncodingMemento();
assertNotNull("couldn't get encoding memento", memento);
} finally {
if (model != null) {
model.releaseFromEdit();
}
}
}
use of org.eclipse.wst.sse.core.internal.encoding.EncodingMemento in project webtools.sourceediting by eclipse.
the class AbstractResourceEncodingDetector method createEncodingMemento.
/**
* Note: once this instance is created, trace info still needs to be
* appended by caller, depending on the context its created.
*/
private void createEncodingMemento(String detectedCharsetName) {
fEncodingMemento = new EncodingMemento();
fEncodingMemento.setJavaCharsetName(getAppropriateJavaCharset(detectedCharsetName));
fEncodingMemento.setDetectedCharsetName(detectedCharsetName);
// TODO: if detectedCharset and spec default is
// null, need to use "work
// bench based" defaults.
fEncodingMemento.setAppropriateDefault(getSpecDefaultEncoding());
}
use of org.eclipse.wst.sse.core.internal.encoding.EncodingMemento in project webtools.sourceediting by eclipse.
the class AbstractResourceEncodingDetector method handleSpecDefault.
private void handleSpecDefault() {
String encodingName;
encodingName = getSpecDefaultEncoding();
if (encodingName != null) {
// createEncodingMemento(encodingName,
// EncodingMemento.USED_CONTENT_TYPE_DEFAULT);
fEncodingMemento = new EncodingMemento();
fEncodingMemento.setJavaCharsetName(encodingName);
fEncodingMemento.setAppropriateDefault(encodingName);
}
}
Aggregations