1 11 package org.eclipse.pde.internal.core.plugin; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.pde.core.IIdentifiable; 15 import org.eclipse.pde.core.plugin.IPluginObject; 16 import org.eclipse.pde.core.plugin.ISharedPluginModel; 17 18 public abstract class IdentifiablePluginObject extends PluginObject implements 19 IIdentifiable { 20 protected String fID; 21 22 public IdentifiablePluginObject() { 23 } 24 25 public String getId() { 26 return fID; 27 } 28 29 public void setId(String id) throws CoreException { 30 ensureModelEditable(); 31 String oldValue = fID; 32 fID = id; 33 firePropertyChanged(P_ID, oldValue, id); 34 } 35 36 public void restoreProperty(String name, Object oldValue, Object newValue) 37 throws CoreException { 38 if (name.equals(P_ID)) { 39 setId(newValue != null ? newValue.toString() : null); 40 return; 41 } 42 super.restoreProperty(name, oldValue, newValue); 43 } 44 45 48 public void reconnect(ISharedPluginModel model, IPluginObject parent) { 49 super.reconnect(model, parent); 50 } 52 53 54 } 55 | Popular Tags |