use of org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser in project webtools.sourceediting by eclipse.
the class BasicStructuredDocument method resetParser.
void resetParser(Reader reader, int startOffset) {
RegionParser parser = getParser();
parser.reset(reader, startOffset);
}
use of org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser in project webtools.sourceediting by eclipse.
the class StyleAttrAdapter method getModel.
/**
*/
public ICSSModel getModel() {
ICSSModel model = getExistingModel();
if (model == null && isModelNecessary()) {
model = createModel();
if (model == null)
return null;
IStructuredDocument structuredDocument = model.getStructuredDocument();
if (structuredDocument == null)
return null;
RegionParser parser = structuredDocument.getParser();
if (parser instanceof CSSSourceParser) {
((CSSSourceParser) parser).setParserMode(CSSSourceParser.MODE_DECLARATION);
} else {
return null;
}
structuredDocument.addDocumentChangedListener(this);
// need to set before valueChanged()
setModel(model);
valueChanged();
}
if (model != null && !isModelNecessary()) {
model = null;
valueChanged();
}
return model;
}
use of org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser in project webtools.sourceediting by eclipse.
the class ElementImpl method isCDATAContainer.
/**
*/
protected boolean isCDATAContainer() {
// use BlockMaker instead of CMElementDeclaration
// because <style> and <script> in XHTML is not CDATA content type
IDOMModel model = getModel();
if (model == null)
// error
return false;
IStructuredDocument structuredDocument = model.getStructuredDocument();
if (structuredDocument == null || fTagName == null)
// eror
return false;
RegionParser parser = structuredDocument.getParser();
if (parser == null || !(parser instanceof XMLSourceParser))
return false;
return (((XMLSourceParser) parser).getBlockMarker(new String(this.fTagName)) != null);
/*
* CMElementDeclaration decl = getDeclaration(); if (decl == null)
* return false; if (decl instanceof CMNodeWrapper) { decl =
* (CMElementDeclaration)((CMNodeWrapper)decl).getOriginNode(); if
* (decl == null) return false; } if (decl instanceof
* TLDElementDeclaration) { String content =
* ((TLDElementDeclaration)decl).getBodycontent(); if (content ==
* null) return false; return
* content.equals(JSP11TLDNames.CONTENT_TAGDEPENDENT); } if
* (!isGlobalTag()) return false; return (decl.getContentType() ==
* CMElementDeclaration.CDATA);
*/
}
Aggregations