1 11 package org.eclipse.debug.internal.core; 12 13 14 import java.util.Comparator ; 15 16 import org.eclipse.core.runtime.CoreException; 17 import org.eclipse.core.runtime.IConfigurationElement; 18 import org.eclipse.debug.core.DebugPlugin; 19 20 23 public class LaunchConfigurationComparator implements Comparator { 24 25 private IConfigurationElement fConfigurationElement; 26 27 private Comparator fDelegate; 28 29 34 public LaunchConfigurationComparator(IConfigurationElement element) { 35 fConfigurationElement = element; 36 } 37 38 41 protected Comparator getComparator() { 42 if (fDelegate == null) { 43 try { 44 fDelegate = (Comparator )fConfigurationElement.createExecutableExtension("class"); } catch (CoreException e) { 46 DebugPlugin.log(e); 47 } 48 } 49 return fDelegate; 50 } 51 52 53 56 public int compare(Object o1, Object o2) { 57 return getComparator().compare(o1, o2); 58 } 59 60 63 public boolean equals(Object obj) { 64 return getComparator().equals(obj); 65 } 66 67 } 68 | Popular Tags |