protected void preLoadAdapt(IStructuredModel structuredModel) { super.preLoadAdapt(structuredModel); IDOMModel domModel = (IDOMModel) structuredModel; // if there is a model in the adapter, this will adapt it to // first node. After that the PropagatingAdater spreads over the // children being // created. Each time that happends, a side effect is to // also "spread" sprecific registered adapters, // they two can propigate is needed. ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class); if (Debug.debugNotificationAndEvents) { PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class); propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory()); } }
public IStructuredModel reinitialize(IStructuredModel model) { EmbeddedTypeHandler oldHandler = null; EmbeddedTypeHandler newHandler = null; Object reinitStateData = model.getReinitializeStateData(); if (reinitStateData instanceof EmbeddedTypeStateData) { EmbeddedTypeStateData oldStateData = (EmbeddedTypeStateData) reinitStateData; oldHandler = oldStateData.getOldHandler(); newHandler = oldStateData.getNewHandler(); // note. We should already have the new handler in the model's // (documents) adapters, // so need need to use the old one to undo the old state data reInitializeEmbeddedType(model, oldHandler, newHandler); } else { // for language ... we someday MIGHT have to do something // here, but for now, we don't have any model-side language // sensitive adapters. } return super.reinitialize(model); }
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 initization 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 implimentaiton of // ModelQueryAdatper 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; }
protected void preLoadAdapt(IStructuredModel structuredModel) { super.preLoadAdapt(structuredModel); // DMW: just added this preload on 8/16/2002 // I noticed the ProagatingAdapterFactory was being added, // that that the ProagatingAdapterAdapter was not being // preload adapted -- I'm assuing it ALWAYS has to be. IDOMModel domModel = (IDOMModel) structuredModel; // if there is a model in the adapter, this will adapt it to // first node. After that the PropagatingAdater spreads over the // children being // created. Each time that happends, a side effect is to // also "spread" sprecific registered adapters, // they two can propigate is needed. ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class); if (Debug.debugNotificationAndEvents) { PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class); propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory()); } }
protected void preLoadAdapt(IStructuredModel structuredModel) { super.preLoadAdapt(structuredModel); IDOMModel domModel = (IDOMModel) structuredModel; // // document must have already been set for this to // work. Document document = domModel.getDocument(); Assert.isNotNull(document); // if there is a model in the adapter, this will adapt it to // first node. After that the PropagatingAdater spreads over the // children being // created. Each time that happends, a side effect is to // also "spread" sprecific registered adapters, // they two can propigate is needed. // This 'get' causes first to be be attached. PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class); // may make this easier to use in futue propagatingAdapter.addAdaptOnCreateFactory(new PageDirectiveWatcherFactory()); if (Debug.debugNotificationAndEvents) { propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory()); } // For JSPs, the ModelQueryAdapter must be "attached" to the document // before content is set in the model, so taglib initization can // take place. ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class); // }