use of org.eclipse.wst.css.core.internal.document.CSSStructuredDocumentRegionContainer in project webtools.sourceediting by eclipse.
the class JSPedCSSModelParser method insertStructuredDocumentRegion.
/**
*/
protected CSSNodeImpl insertStructuredDocumentRegion(IStructuredDocumentRegion region) {
CSSModelCreationContext creationContext = getCreationContext();
if (creationContext == null || region == null) {
return null;
}
String type = ((BasicStructuredDocumentRegion) region).getType();
CSSNodeImpl modified = null;
if (type == JSPedCSSRegionContexts.CSS_JSP_DIRECTIVE) {
boolean isInclude = region.getText().indexOf("include") != -1;
if (isInclude) {
modified = insertUnknownImport(region);
} else {
modified = insertUnknownRule(region);
}
}
// post process
if (modified != null) {
if (modified instanceof CSSStructuredDocumentRegionContainer) {
((CSSStructuredDocumentRegionContainer) modified).propagateRangeStructuredDocumentRegion();
}
}
return modified != null ? modified : super.insertStructuredDocumentRegion(region);
}
Aggregations