1 11 package org.eclipse.pde.internal.core.schema; 12 13 import java.io.PrintWriter ; 14 import java.net.URL ; 15 16 import org.eclipse.pde.core.IEditable; 17 import org.eclipse.pde.core.IModelChangedEvent; 18 import org.eclipse.pde.internal.core.ischema.ISchemaDescriptor; 19 20 public class EditableSchema extends Schema implements IEditable { 21 22 public EditableSchema(ISchemaDescriptor schemaDescriptor, URL url, boolean abbreviated) { 23 super(schemaDescriptor, url, abbreviated); 24 } 25 26 public EditableSchema(String pluginId, String pointId, String name, boolean abbreviated) { 27 super(pluginId, pointId, name, abbreviated); 28 } 29 30 31 private boolean dirty; 32 33 public void fireModelChanged(IModelChangedEvent event) { 34 if (isNotificationEnabled()) 35 dirty = true; 36 super.fireModelChanged(event); 37 } 38 39 public boolean isDirty() { 40 return dirty; 41 } 42 43 public boolean isEditable() { 44 return true; 45 } 46 47 public void save(PrintWriter writer) { 48 this.write("", writer); dirty = false; 50 } 51 52 public void setDirty(boolean newDirty) { 53 dirty = newDirty; 54 } 55 } 56 | Popular Tags |