Search in sources :

Example 21 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(String prefix, CMDocument doc) {
    if (doc.getElements().getLength() > 0) {
        Iterator elements = doc.getElements().iterator();
        CMNode node = null;
        while (elements.hasNext()) {
            node = (CMNode) elements.next();
            if (node instanceof TLDElementDeclaration && ((TLDElementDeclaration) node).getBodycontent().equals(JSP12TLDNames.CONTENT_TAGDEPENDENT))
                getBlockMarkers().add(new BlockMarker(prefix + node.getNodeName(), null, DOMRegionContext.BLOCK_TEXT, true));
            else
                getBlockMarkers().add(new BlockMarker(prefix + node.getNodeName(), null, DOMJSPRegionContexts.JSP_CONTENT, true));
        }
    }
}
Also used : TLDElementDeclaration(org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.TLDElementDeclaration) Iterator(java.util.Iterator) BlockMarker(org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker) CMNode(org.eclipse.wst.xml.core.internal.contentmodel.CMNode)

Example 22 with BlockMarker

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

the class EmbeddedHTML method addHTMLishTag.

/**
 * Convenience method to add tag names using BlockMarker object
 */
private void addHTMLishTag(BlockTagParser parser, String tagname) {
    BlockMarker bm = new BlockMarker(tagname, null, DOMRegionContext.BLOCK_TEXT, false);
    parser.addBlockMarker(bm);
}
Also used : BlockMarker(org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker)

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