1 11 package org.eclipse.pde.internal.core.text.build; 12 13 import java.io.IOException ; 14 import java.io.InputStream ; 15 16 import org.eclipse.core.runtime.CoreException; 17 import org.eclipse.jface.text.IDocument; 18 import org.eclipse.pde.core.build.IBuild; 19 import org.eclipse.pde.core.build.IBuildModel; 20 import org.eclipse.pde.core.build.IBuildModelFactory; 21 import org.eclipse.pde.internal.core.NLResourceHelper; 22 import org.eclipse.pde.internal.core.text.AbstractEditingModel; 23 24 25 public class BuildModel extends AbstractEditingModel implements IBuildModel { 26 27 private BuildModelFactory fFactory; 29 private Build fBuild; 30 31 35 public BuildModel(IDocument document, boolean isReconciling) { 36 super(document, isReconciling); 37 } 38 41 protected NLResourceHelper createNLResourceHelper() { 42 return null; 43 } 44 45 48 public void load(InputStream source, boolean outOfSync) throws CoreException { 49 try { 50 fLoaded = true; 51 ((Build)getBuild()).load(source); 52 } catch (IOException e) { 53 fLoaded = false; 54 } 55 } 56 57 60 public void adjustOffsets(IDocument document) { 61 ((Build)getBuild()).adjustOffsets(document); 62 } 63 64 67 public IBuild getBuild() { 68 if (fBuild == null) 69 fBuild = new Build(this); 70 return fBuild; 71 } 72 75 public IBuildModelFactory getFactory() { 76 if (fFactory == null) 77 fFactory = new BuildModelFactory(this); 78 return fFactory; 79 } 80 } | Popular Tags |