1 11 package org.eclipse.jdt.internal.ui.wizards.buildpaths; 12 13 import org.eclipse.core.runtime.Assert; 14 import org.eclipse.core.runtime.IPath; 15 16 import org.eclipse.jdt.core.JavaCore; 17 18 19 public class CPVariableElement { 20 21 private String fName; 22 private IPath fPath; 23 24 28 public CPVariableElement(String name, IPath path) { 29 Assert.isNotNull(name); 30 Assert.isNotNull(path); 31 fName= name; 32 fPath= path; 33 } 34 35 39 public IPath getPath() { 40 return fPath; 41 } 42 43 47 public void setPath(IPath path) { 48 Assert.isNotNull(path); 49 fPath= path; 50 } 51 52 56 public String getName() { 57 return fName; 58 } 59 60 64 public void setName(String name) { 65 Assert.isNotNull(name); 66 fName= name; 67 } 68 69 72 public boolean equals(Object other) { 73 if (other != null && other.getClass().equals(getClass())) { 74 CPVariableElement elem= (CPVariableElement)other; 75 return fName.equals(elem.fName); 76 } 77 return false; 78 } 79 80 83 public int hashCode() { 84 return fName.hashCode(); 85 } 86 87 90 public boolean isReadOnly() { 91 return JavaCore.isClasspathVariableReadOnly(fName); 92 } 93 94 97 public boolean isDeprecated() { 98 return JavaCore.getClasspathVariableDeprecationMessage(fName) != null; 99 } 100 101 104 public String getDeprecationMessage() { 105 return BuildPathSupport.getDeprecationMessage(fName); 106 } 107 } 108 | Popular Tags |