Search in sources :

Example 1 with JSPReParser

use of org.eclipse.jst.jsp.core.internal.parser.JSPReParser in project webtools.sourceediting by eclipse.

the class JSPDocumentLoader method newEncodedDocument.

/**
 * This method must return a new instance of IStructuredDocument, that has
 * been initialized with appropriate parser. For many loaders, the
 * (default) parser used is known for any input. For others, the correct
 * parser (and its initialization) is normall dependent on the content of
 * the file. This no-argument method should assume "empty input" and would
 * therefore return the default parser for the default contentType. If the
 * parser is to handle tag libraries, it must have a TaglibSupport object
 * with a valid URIResolver and this IStructuredDocument attached to it
 * before the contents are set on the IStructuredDocument.
 */
protected IEncodedDocument newEncodedDocument() {
    IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
    ((BasicStructuredDocument) structuredDocument).setReParser(new JSPReParser());
    // structuredDocument.setDocumentPartitioner(new
    // JSPJavaDocumentPartioner());
    // even though this is an "empty model" ... we want it to have at
    // least
    // the
    // default embeddeded content type handler
    EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType();
    embeddedType.initializeParser(structuredDocument.getParser());
    return structuredDocument;
}
Also used : EmbeddedTypeHandler(org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler) BasicStructuredDocument(org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument) JSPReParser(org.eclipse.jst.jsp.core.internal.parser.JSPReParser)

Example 2 with JSPReParser

use of org.eclipse.jst.jsp.core.internal.parser.JSPReParser in project webtools.sourceediting by eclipse.

the class JSPModelLoader method newStructuredDocument.

/**
 * This method must return a new instance of IStructuredDocument, that has
 * been initialized with appropriate parser. For many loaders, the
 * (default) parser used is known for any input. For others, the correct
 * parser (and its initialization) is normall dependent on the content of
 * the file. This no-argument method should assume "empty input" and would
 * therefore return the default parser for the default contentType.
 *
 * If the parser is to handle tag libraries, it must have a TaglibSupport
 * object with a valid URIResolver and this IStructuredDocument attached
 * to it before the contents are set on the IStructuredDocument.
 */
public IStructuredDocument newStructuredDocument() {
    IStructuredDocument structuredDocument = StructuredDocumentFactory.getNewStructuredDocumentInstance(getParser());
    ((BasicStructuredDocument) structuredDocument).setReParser(new JSPReParser());
    // structuredDocument.setDocumentPartitioner(new
    // JSPJavaDocumentPartioner());
    // even though this is an "empty model" ... we want it to have at
    // least the
    // default embeddeded content type handler
    EmbeddedTypeHandler embeddedType = getJSPDefaultEmbeddedType(null);
    embeddedType.initializeParser(structuredDocument.getParser());
    return structuredDocument;
}
Also used : EmbeddedTypeHandler(org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler) BasicStructuredDocument(org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument) JSPReParser(org.eclipse.jst.jsp.core.internal.parser.JSPReParser)

Aggregations

JSPReParser (org.eclipse.jst.jsp.core.internal.parser.JSPReParser)2 EmbeddedTypeHandler (org.eclipse.wst.sse.core.internal.ltk.modelhandler.EmbeddedTypeHandler)2 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)2 BasicStructuredDocument (org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument)2