1 11 12 package org.eclipse.pde.internal.ui.templates; 13 14 import org.eclipse.core.runtime.CoreException; 15 import org.eclipse.pde.core.plugin.IPluginReference; 16 17 public class PluginReference implements IPluginReference { 18 private int match = NONE; 19 private String version; 20 private String id; 21 22 25 public PluginReference() { 26 super(); 27 } 28 29 public boolean equals(Object object) { 30 if (object instanceof IPluginReference) { 31 IPluginReference source = (IPluginReference)object; 32 if (id==null) return false; 33 if (id.equals(source.getId())==false) return false; 34 if (version==null && source.getVersion()==null) return true; 35 return version.equals(source.getVersion()); 36 } 37 return false; 38 } 39 40 public PluginReference(String id, String version, int match) { 41 this.id = id; 42 this.version = version; 43 this.match = match; 44 } 45 46 49 public int getMatch() { 50 return match; 51 } 52 53 56 public String getVersion() { 57 return version; 58 } 59 60 63 public void setMatch(int match) throws CoreException { 64 this.match = match; 65 } 66 67 70 public void setVersion(String version) throws CoreException { 71 this.version = version; 72 } 73 74 77 public String getId() { 78 return id; 79 } 80 81 84 public void setId(String id) throws CoreException { 85 this.id = id; 86 } 87 88 } 89 | Popular Tags |