1 11 package org.eclipse.pde.internal.ui.model.plugin; 12 13 import org.eclipse.core.runtime.*; 14 import org.eclipse.jface.text.*; 15 import org.eclipse.pde.core.plugin.*; 16 import org.eclipse.pde.internal.ui.model.*; 17 import org.xml.sax.SAXException ; 18 19 public abstract class AbstractPluginDocumentHandler extends DocumentHandler { 20 21 private PluginModelBase fModel; 22 private String fSchemaVersion; 23 24 27 public AbstractPluginDocumentHandler(PluginModelBase model) { 28 fModel = model; 29 } 30 31 34 protected IDocument getDocument() { 35 return fModel.getDocument(); 36 } 37 38 41 public void endDocument() throws SAXException { 42 IPluginBase pluginBase = fModel.getPluginBase(); 43 try { 44 if (pluginBase != null) 45 pluginBase.setSchemaVersion(fSchemaVersion); 46 } catch (CoreException e) { 47 } 48 } 49 50 51 54 public void processingInstruction(String target, String data) 55 throws SAXException { 56 if ("eclipse".equals(target)) { fSchemaVersion = "3.0"; } 59 } 60 61 64 public void startDocument() throws SAXException { 65 super.startDocument(); 66 fSchemaVersion = null; 67 } 68 protected PluginModelBase getModel() { 69 return fModel; 70 } 71 } 72 | Popular Tags |