KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > core > build > BuildObject


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 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.core.build;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IStatus;
15 import org.eclipse.core.runtime.Status;
16 import org.eclipse.pde.core.build.IBuildModel;
17 import org.eclipse.pde.internal.core.PDECore;
18 import org.eclipse.pde.internal.core.PDECoreMessages;
19
20 public class BuildObject implements IBuildObject {
21     private IBuildModel fModel;
22
23     private boolean fInTheModel;
24
25     public boolean isInTheModel() {
26         return fInTheModel;
27     }
28
29     public void setInTheModel(boolean inTheModel) {
30         fInTheModel = inTheModel;
31     }
32
33     protected void ensureModelEditable() throws CoreException {
34         if (!fModel.isEditable()) {
35             throwCoreException(PDECoreMessages.BuildObject_readOnlyException);
36         }
37     }
38
39     public IBuildModel getModel() {
40         return fModel;
41     }
42
43     void setModel(IBuildModel model) {
44         fModel = model;
45     }
46
47     protected void throwCoreException(String JavaDoc message) throws CoreException {
48         Status status = new Status(IStatus.ERROR, PDECore.PLUGIN_ID,
49                 IStatus.OK, message, null);
50         throw new CoreException(status);
51     }
52
53     public void restoreProperty(String JavaDoc name, Object JavaDoc oldValue, Object JavaDoc newValue)
54             throws CoreException {
55     }
56 }
57
Popular Tags