1 11 package org.eclipse.ui.externaltools.internal.launchConfigurations; 12 13 import java.util.Comparator ; 14 15 import org.eclipse.debug.ui.RefreshTab; 16 import org.eclipse.ui.IWorkingSet; 17 18 22 public class WorkingSetComparator implements Comparator { 23 24 27 public int compare(Object o1, Object o2) { 28 String one= (String )o1; 29 String two= (String )o2; 30 if (one == null || two == null) { 31 if (one == two) { 32 return 0; 33 } 34 return -1; 35 } 36 if (one.startsWith("${working_set:") && two.startsWith("${working_set:")) { IWorkingSet workingSet1 = RefreshTab.getWorkingSet(one); 38 IWorkingSet workingSet2 = RefreshTab.getWorkingSet(two); 39 if (workingSet1 == null || workingSet2 == null) { 40 if (workingSet1 == workingSet2) { 41 return 0; 42 } 43 return -1; 44 } 45 if (workingSet1.equals(workingSet2)) { 46 return 0; 47 } 48 return -1; 49 } 50 return one.compareTo(two); 51 } 52 } 53 | Popular Tags |