1 11 12 package org.eclipse.ui.internal.menus; 13 14 import org.eclipse.jface.util.Util; 15 import org.eclipse.ui.internal.misc.Policy; 16 17 40 public abstract class LeafLocationElement implements LocationElement { 41 42 45 public static final String BREAKPOINT_PATH = "org.eclipse.search.menu"; 47 50 public static final char PATH_SEPARATOR = '/'; 51 52 56 private final String path; 57 58 66 public LeafLocationElement(final String path) { 67 if (Policy.EXPERIMENTAL_MENU && path != null 68 && path.indexOf(BREAKPOINT_PATH) > -1) { 69 System.err.println("LeafLocationElement: " + path); } 71 this.path = path; 72 } 73 74 81 public final String getPath() { 82 return path; 83 } 84 85 93 public abstract ILocationElementTokenizer getTokenizer(); 94 95 98 public boolean equals(Object obj) { 99 if (this==obj) { 100 return true; 101 } 102 if (obj instanceof LeafLocationElement) { 103 LeafLocationElement leaf = (LeafLocationElement) obj; 104 return Util.equals(path, leaf.path); 105 } 106 return false; 107 } 108 109 112 public int hashCode() { 113 return Util.hashCode(path); 114 } 115 } 116 | Popular Tags |