use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.
the class ScanningTests method newParser.
public static RegionParser newParser() {
JSPSourceParser parser = new JSPSourceParser();
parser.addBlockMarker(new BlockMarker("foo", null, DOMRegionContext.BLOCK_TEXT, true));
parser.addBlockMarker(new BlockMarker("globalFoo", null, DOMRegionContext.BLOCK_TEXT, true));
// parser.addBlockMarker(new BlockMarker("jsp:text", null, XMLRegionContext.XML_CDATA_TEXT, true));
return parser;
}
use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.
the class UnitTests method testDeepEmbeddedJSP3.
public void testDeepEmbeddedJSP3() {
// CMVC 245586
// this is a test to make sure ContextRegionContainer returns what we expect
setUpJSP();
String startString = "<html><head><script> <%! String testvar = \"testvar\"; %> var test = <%= testvar %> </script></head></html>";
String expectedText = "<%! String testvar = \"testvar\"; %>";
// $NON-NLS-1$
((XMLSourceParser) fModel.getParser()).addBlockMarker(new BlockMarker("script", null, DOMRegionContext.BLOCK_TEXT, false));
fModel.setText(null, startString);
fModel.getRegionList();
IStructuredDocumentRegion scriptBlockRegion = fModel.getRegionAtCharacterOffset(21);
ITextRegionList blockRegions = scriptBlockRegion.getRegions();
ITextRegionContainer jspDecl = (ITextRegionContainer) blockRegions.get(1);
String fullText = jspDecl.getFullText();
// assertTrue("ContextRegionContainer.getFullText()", fullText.equals(expectedText));
assertEquals("ContextRegionContainer.getFullText() value incorrect: ", expectedText, fullText);
}
use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.
the class XMLLineTokenizer 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;
}
use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.
the class JSPContentAssistProcessor method decodeScriptBlock.
/*
* ** TEMP WORKAROUND FOR CMVC 241882 Takes a String and blocks out
* jsp:scriptlet, jsp:expression, and jsp:declaration @param blockText
* @return
*/
private IStructuredDocumentRegion decodeScriptBlock(String blockText) {
XMLSourceParser parser = new XMLSourceParser();
// use JSP_CONTENT for region type
// $NON-NLS-1$
parser.addBlockMarker(new BlockMarker("jsp:scriptlet", null, DOMJSPRegionContexts.JSP_CONTENT, false, false));
// $NON-NLS-1$
parser.addBlockMarker(new BlockMarker("jsp:expression", null, DOMJSPRegionContexts.JSP_CONTENT, false, false));
// $NON-NLS-1$
parser.addBlockMarker(new BlockMarker("jsp:declaration", null, DOMJSPRegionContexts.JSP_CONTENT, false, false));
parser.reset(blockText);
return parser.getDocumentRegions();
}
use of org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker in project webtools.sourceediting by eclipse.
the class ModelHandlerForJSP method addJSPTagName.
protected void addJSPTagName(JSPSourceParser parser, String tagname) {
BlockMarker bm = new BlockMarker(tagname, null, DOMJSPRegionContexts.JSP_CONTENT, true);
parser.addBlockMarker(bm);
}
Aggregations