Search in sources :

Example 1 with BlockMarker

use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project liferay-ide by liferay.

the class AlloyJSPDocumentLoader method newEncodedDocument.

@Override
protected IEncodedDocument newEncodedDocument() {
    IEncodedDocument retval = super.newEncodedDocument();
    if (retval instanceof IStructuredDocument) {
        IStructuredDocument doc = (IStructuredDocument) retval;
        RegionParser parser = doc.getParser();
        if (parser instanceof BlockTagParser) {
            BlockTagParser blockParser = (BlockTagParser) parser;
            BlockMarker bm = new BlockMarker("aui:script", null, DOMRegionContext.BLOCK_TEXT, false);
            blockParser.addBlockMarker(bm);
        }
    }
    return retval;
}
Also used : BlockMarker(org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument) BlockTagParser(org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser) IEncodedDocument(org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument) RegionParser(org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser)

Example 2 with BlockMarker

use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.

the class HTMLTokenizer method getBlockMarkerCaseSensitivity.

/* user method */
public boolean getBlockMarkerCaseSensitivity(String name) {
    Iterator iterator = fBlockMarkers.iterator();
    while (iterator.hasNext()) {
        BlockMarker marker = (BlockMarker) iterator.next();
        boolean casesensitive = marker.isCaseSensitive();
        if (casesensitive && marker.getTagName().equals(name))
            return casesensitive;
        else if (!casesensitive && marker.getTagName().equalsIgnoreCase(name))
            return casesensitive;
    }
    return true;
}
Also used : Iterator(java.util.Iterator) BlockMarker(org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker)

Example 3 with BlockMarker

use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.

the class JSPTranslator method addBlockMarkers.

/*
	 * adds block markers to JSPTranslator's block marker list for all
	 * elements in doc @param doc
	 */
protected void addBlockMarkers(CMDocument doc) {
    if (doc.getElements().getLength() > 0) {
        Iterator elements = doc.getElements().iterator();
        CMNode node = null;
        while (elements.hasNext()) {
            node = (CMNode) elements.next();
            getBlockMarkers().add(new BlockMarker(node.getNodeName(), null, DOMJSPRegionContexts.JSP_CONTENT, true));
        }
    }
}
Also used : Iterator(java.util.Iterator) BlockMarker(org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker) CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 4 with BlockMarker

use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.

the class ScannerUnitTests method setUpJSP.

protected IStructuredDocumentRegionList setUpJSP(String text) {
    setupModel(new ModelHandlerForJSP());
    parser.addBlockMarker(new BlockMarker("script", null, DOMRegionContext.BLOCK_TEXT, false));
    parser.addBlockMarker(new BlockMarker("style", null, DOMRegionContext.BLOCK_TEXT, false));
    parser.addBlockMarker(new BlockMarker("disallowJSP", null, DOMRegionContext.BLOCK_TEXT, true, false));
    /*
		 * IStructuredDocumentRegionList nodes = setUpJSP("content <script>
		 * <%= expression %> </script> <a> </a> <foo:disallowJSP> <%= %>
		 * </foo:disallowJSP> >"); parser.addBlockMarker(new
		 * BlockMarker("jsp:declaration", null,
		 * XMLJSPRegionContexts.JSP_CONTENT, true)); parser.addBlockMarker(new
		 * BlockMarker("jsp:expression", null,
		 * XMLJSPRegionContexts.JSP_CONTENT, true)); parser.addBlockMarker(new
		 * BlockMarker("jsp:scriptlet", null,
		 * XMLJSPRegionContexts.JSP_CONTENT, true));
		 */
    input = text;
    fModel.set(input);
    return fModel.getRegionList();
}
Also used : BlockMarker(org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker) ModelHandlerForJSP(org.eclipse.jst.jsp.core.internal.modelhandler.ModelHandlerForJSP)

Example 5 with BlockMarker

use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.

the class ScannerUnitTests method setUpXML.

protected IStructuredDocumentRegionList setUpXML(String text) {
    setupModel(new ModelHandlerForXML());
    parser.addBlockMarker(new BlockMarker("script", null, DOMRegionContext.BLOCK_TEXT, false));
    parser.addBlockMarker(new BlockMarker("style", null, DOMRegionContext.BLOCK_TEXT, false));
    parser.addBlockMarker(new BlockMarker("disallowJSP", null, DOMRegionContext.BLOCK_TEXT, true, false));
    input = text;
    fModel.set(input);
    return fModel.getRegionList();
}
Also used : BlockMarker(org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker) ModelHandlerForXML(org.eclipse.wst.xml.core.internal.modelhandler.ModelHandlerForXML)

Aggregations

BlockMarker (org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker)22 Iterator (java.util.Iterator)8 XMLSourceParser (org.eclipse.wst.xml.core.internal.parser.XMLSourceParser)4 BlockTagParser (org.eclipse.wst.sse.core.internal.ltk.parser.BlockTagParser)2 RegionParser (org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser)2 CMNode (org.eclipse.wst.xml.core.internal.contentmodel.CMNode)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 BadLocationException (org.eclipse.jface.text.BadLocationException)1 IDocumentExtension3 (org.eclipse.jface.text.IDocumentExtension3)1 TLDElementDeclaration (org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration)1 ModelHandlerForJSP (org.eclipse.jst.jsp.core.internal.modelhandler.ModelHandlerForJSP)1 JSPSourceParser (org.eclipse.jst.jsp.core.internal.parser.JSPSourceParser)1 StructuredDocumentRegionHandler (org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandler)1 StructuredDocumentRegionHandlerExtension (org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionHandlerExtension)1 StructuredDocumentRegionParser (org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParser)1 StructuredDocumentRegionParserExtension (org.eclipse.wst.sse.core.internal.ltk.parser.StructuredDocumentRegionParserExtension)1 IEncodedDocument (org.eclipse.wst.sse.core.internal.provisional.document.IEncodedDocument)1 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)1 IStructuredDocumentRegion (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion)1