KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > ui > model > build > BuildModel


1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.ui.model.build;
12
13 import java.io.*;
14 import org.eclipse.core.runtime.*;
15 import org.eclipse.jface.text.*;
16 import org.eclipse.pde.core.build.*;
17 import org.eclipse.pde.internal.core.*;
18 import org.eclipse.pde.internal.ui.model.*;
19
20
21 public class BuildModel extends AbstractEditingModel implements IBuildModel {
22     
23     //private Properties fProperties;
24
private BuildModelFactory fFactory;
25     private Build fBuild;
26
27     /**
28      * @param document
29      * @param isReconciling
30      */

31     public BuildModel(IDocument document, boolean isReconciling) {
32         super(document, isReconciling);
33     }
34     /* (non-Javadoc)
35      * @see org.eclipse.pde.internal.ui.model.AbstractEditingModel#createNLResourceHelper()
36      */

37     protected NLResourceHelper createNLResourceHelper() {
38         return null;
39     }
40
41     /* (non-Javadoc)
42      * @see org.eclipse.pde.core.IModel#load(java.io.InputStream, boolean)
43      */

44     public void load(InputStream source, boolean outOfSync) throws CoreException {
45         try {
46             fLoaded = true;
47             ((Build)getBuild()).load(source);
48         } catch (IOException e) {
49             fLoaded = false;
50         }
51     }
52     
53     /* (non-Javadoc)
54      * @see org.eclipse.pde.internal.ui.model.AbstractEditingModel#adjustOffsets(org.eclipse.jface.text.IDocument)
55      */

56     protected void adjustOffsets(IDocument document) {
57         ((Build)getBuild()).adjustOffsets(document);
58     }
59     
60     /* (non-Javadoc)
61      * @see org.eclipse.pde.core.build.IBuildModel#getBuild()
62      */

63     public IBuild getBuild() {
64         if (fBuild == null)
65             fBuild = new Build(this);
66         return fBuild;
67     }
68     /* (non-Javadoc)
69      * @see org.eclipse.pde.core.build.IBuildModel#getFactory()
70      */

71     public IBuildModelFactory getFactory() {
72         if (fFactory == null)
73             fFactory = new BuildModelFactory(this);
74         return fFactory;
75     }
76 }
77
Popular Tags