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); } }
/** * 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()); }
protected String getPreferredNewLineDelimiter(IFile file) { String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForHTML.ContentTypeID_HTML); if (delimiter == null) delimiter = super.getPreferredNewLineDelimiter(file); return delimiter; }
/** * @param contents * @param description * @throws IOException */ private void calculateSupportedOptions(Reader contents, IContentDescription description) throws IOException { if (isRelevent(description)) { IResourceCharsetDetector detector = getDetector(); detector.set(contents); handleCalculations(description, detector); } }
/** * */ public NullMemento() { super(); String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null); setJavaCharsetName(defaultCharset); setAppropriateDefault(defaultCharset); setDetectedCharsetName(null); }
public EncodingMemento getSpecDefaultEncodingMemento() { resetAll(); EncodingMemento result = null; String enc = getSpecDefaultEncoding(); if (enc != null) { createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT); fEncodingMemento.setAppropriateDefault(enc); result = fEncodingMemento; } return result; }
public String getEncoding() throws IOException { return getEncodingMemento().getDetectedCharsetName(); }
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); } }
private int calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException { int result = IContentDescriber.INDETERMINATE; if (isRelevent(description)) { IResourceCharsetDetector detector = getDetector(); detector.set(contents); handleCalculations(description, detector); result = IContentDescriber.VALID; } return result; }
/** * */ public NullMemento() { super(); String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null); setJavaCharsetName(defaultCharset); setAppropriateDefault(defaultCharset); setDetectedCharsetName(null); } }
protected String getPreferredNewLineDelimiter(IFile file) { String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(CSS_ID); if (delimiter == null) delimiter = super.getPreferredNewLineDelimiter(file); return delimiter; }
public EncodingMemento getSpecDefaultEncodingMemento() { resetAll(); EncodingMemento result = null; String enc = getSpecDefaultEncoding(); if (enc != null) { createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT); fEncodingMemento.setAppropriateDefault(enc); result = fEncodingMemento; } return result; }
private int calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException { int result = IContentDescriber.INDETERMINATE; if (isRelevent(description)) { IResourceCharsetDetector detector = getDetector(); detector.set(contents); handleCalculations(description, detector); result = IContentDescriber.VALID; } return result; }
/** * */ public NullMemento() { super(); String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null); setJavaCharsetName(defaultCharset); setAppropriateDefault(defaultCharset); setDetectedCharsetName(null); }
protected String getPreferredNewLineDelimiter(IFile file) { String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForXML.ContentTypeID_XML); if (delimiter == null) delimiter = super.getPreferredNewLineDelimiter(file); return delimiter; }
public EncodingMemento getSpecDefaultEncodingMemento() { resetAll(); EncodingMemento result = null; String enc = getSpecDefaultEncoding(); if (enc != null) { createEncodingMemento(enc, EncodingMemento.DEFAULTS_ASSUMED_FOR_EMPTY_INPUT); fEncodingMemento.setAppropriateDefault(enc); result = fEncodingMemento; } return result; }
private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException { if (isRelevent(description)) { IResourceCharsetDetector detector = getDetector(); detector.set(contents); handleCalculations(description, detector); } }
/** * */ public NullMemento() { super(); String defaultCharset = NonContentBasedEncodingRules.useDefaultNameRules(null); setJavaCharsetName(defaultCharset); setAppropriateDefault(defaultCharset); setDetectedCharsetName(null); }
protected String getPreferredNewLineDelimiter(IFile file) { String delimiter = ContentTypeEncodingPreferences.getPreferredNewLineDelimiter(ContentTypeIdForJSP.ContentTypeID_JSP); if (delimiter == null) delimiter = super.getPreferredNewLineDelimiter(file); return delimiter; }
private void calculateSupportedOptions(InputStream contents, IContentDescription description) throws IOException { if (isRelevent(description)) { IResourceCharsetDetector detector = getDetector(); detector.set(contents); handleCalculations(description, detector); } }