01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.core.build;
11:
12: import org.eclipse.core.runtime.CoreException;
13: import org.eclipse.core.runtime.IStatus;
14: import org.eclipse.core.runtime.Status;
15: import org.eclipse.pde.core.build.IBuildModel;
16: import org.eclipse.pde.internal.core.PDECore;
17: import org.eclipse.pde.internal.core.PDECoreMessages;
18:
19: public class BuildObject implements IBuildObject {
20: private IBuildModel fModel;
21:
22: private boolean fInTheModel;
23:
24: public boolean isInTheModel() {
25: return fInTheModel;
26: }
27:
28: public void setInTheModel(boolean inTheModel) {
29: fInTheModel = inTheModel;
30: }
31:
32: protected void ensureModelEditable() throws CoreException {
33: if (!fModel.isEditable()) {
34: throwCoreException(PDECoreMessages.BuildObject_readOnlyException);
35: }
36: }
37:
38: public IBuildModel getModel() {
39: return fModel;
40: }
41:
42: void setModel(IBuildModel model) {
43: fModel = model;
44: }
45:
46: protected void throwCoreException(String message)
47: 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 name, Object oldValue,
54: Object newValue) throws CoreException {
55: }
56: }
|