}
/**
*/
public ICSSModel getModel() {
ICSSModel model = getExistingModel();
if (this.replaceModel) {
ICSSModel oldModel = model;
model = createModel(false);
setModel(model, false); // need to set before contentChanged()
contentChanged();
// from super.createModel()
// get ModelProvideAdapter
IModelProvideAdapter modelProvideAdapter = (IModelProvideAdapter) ((INodeNotifier) getElement()).getAdapterFor(IModelProvideAdapter.class);
// notify adapter
if (modelProvideAdapter != null)
modelProvideAdapter.modelProvided(model);
// from createModel()
IStructuredDocument structuredDocument = null;
if (model != null)
structuredDocument = model.getStructuredDocument();
if (structuredDocument == null)
return null;
structuredDocument.addDocumentChangedListener(this);
// from setModel()
if (oldModel != null)
oldModel.removeStyleListener(this);
if (model != null)
model.addStyleListener(this);
if (oldModel != null) {
// get ModelProvideAdapter