1 11 package org.eclipse.pde.internal.core.schema; 12 13 import java.net.*; 14 15 import org.eclipse.core.runtime.IPath; 16 import org.eclipse.pde.internal.core.ischema.*; 17 18 public abstract class AbstractSchemaDescriptor implements ISchemaDescriptor { 19 protected Schema schema; 20 21 public AbstractSchemaDescriptor() { 22 super(); 23 } 24 25 public IPath getPluginRelativePath(String pluginId, IPath path) { 26 return null; 27 } 28 29 protected Schema createSchema() { 30 URL url = getSchemaURL(); 31 if (url == null) 32 return null; 33 return new Schema(this, url); 34 } 35 public void dispose() { 36 if (schema != null && schema.isDisposed() == false) { 37 schema.dispose(); 38 } 39 schema = null; 40 } 41 42 public ISchema getSchema() { 43 if (schema == null) { 44 loadSchema(); 45 } 46 return schema; 47 } 48 protected void loadSchema() { 49 schema = createSchema(); 50 if (schema != null) 51 schema.load(); 52 } 53 public void reload() { 54 if (schema != null) { 55 schema.reload(); 56 } 57 } 58 public boolean isStandalone() { 59 return false; 60 } 61 62 public abstract boolean isEnabled(); 63 } 64 | Popular Tags |