use of org.eclipse.jst.jsp.core.internal.modelquery.JSPModelQueryAdapterImpl in project webtools.sourceediting by eclipse.
the class JSPModelLoader method createModel.
public IStructuredModel createModel(IStructuredModel oldModel) {
IStructuredModel model = super.createModel(oldModel);
// For JSPs, the ModelQueryAdapter must be "attached" to the document
// before content is set in the model, so taglib initialization can
// take place.
// In this "clone model" case, we create a ModelQuery adapter
// create a new instance from the old data. Note: I think this
// "forced fit" only works here since the implementation of
// ModelQueryAdapter does not
// have to be released.
ModelQueryAdapter modelQueryAdapter = getModelQueryAdapter(model);
if (modelQueryAdapter == null) {
modelQueryAdapter = getModelQueryAdapter(oldModel);
IDOMDocument document = ((IDOMModel) model).getDocument();
document.addAdapter(new JSPModelQueryAdapterImpl(modelQueryAdapter.getCMDocumentCache(), modelQueryAdapter.getModelQuery(), modelQueryAdapter.getIdResolver()));
}
return model;
}
Aggregations