1 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 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 name, Object oldValue, Object newValue) 54 throws CoreException { 55 } 56 } 57 | Popular Tags |