*/
private ProjectionModelNodeAdapterFactoryHTML getAdapterFactoryHTML(
boolean createIfNeeded) {
final long start = System.currentTimeMillis();
ProjectionModelNodeAdapterFactoryHTML factory = null;
if (fDocument != null) {
IStructuredModel sModel = null;
try {
sModel = StructuredModelManager.getModelManager()
.getExistingModelForRead(fDocument);
if (sModel != null && (sModel instanceof IDOMModel)) {
final FactoryRegistry factoryRegistry = sModel
.getFactoryRegistry();
// getting the projectionmodelnodeadapter for the first
// time
// so do some initializing
if (!factoryRegistry
.contains(ProjectionModelNodeAdapterHTML.class)
&& createIfNeeded) {
final ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();
// add factory to factory registry
factoryRegistry.addFactory(newFactory);
// add factory to propogating adapter