1 11 package org.eclipse.core.internal.preferences; 12 13 import org.eclipse.core.runtime.IPath; 14 import org.eclipse.core.runtime.preferences.IEclipsePreferences; 15 import org.eclipse.core.runtime.preferences.IScopeContext; 16 17 23 public abstract class AbstractScope implements IScopeContext { 24 25 28 public abstract String getName(); 29 30 35 public IEclipsePreferences getNode(String qualifier) { 36 if (qualifier == null) 37 throw new IllegalArgumentException (); 38 return (IEclipsePreferences) PreferencesService.getDefault().getRootNode().node(getName()).node(qualifier); 39 } 40 41 44 public abstract IPath getLocation(); 45 46 49 public boolean equals(Object obj) { 50 if (this == obj) 51 return true; 52 if (!(obj instanceof IScopeContext)) 53 return false; 54 IScopeContext other = (IScopeContext) obj; 55 if (!getName().equals(other.getName())) 56 return false; 57 IPath location = getLocation(); 58 return location == null ? other.getLocation() == null : location.equals(other.getLocation()); 59 } 60 61 64 public int hashCode() { 65 return getName().hashCode(); 66 } 67 } 68 | Popular Tags |