1 11 12 package org.eclipse.ui.internal.dialogs; 13 14 import org.eclipse.jface.viewers.IBasicPropertyConstants; 15 import org.eclipse.jface.viewers.ViewerSorter; 16 import org.eclipse.ui.internal.registry.WizardsRegistryReader; 17 18 31 class DataTransferWizardCollectionSorter extends ViewerSorter { 32 35 public final static DataTransferWizardCollectionSorter INSTANCE = new DataTransferWizardCollectionSorter(); 36 37 42 private DataTransferWizardCollectionSorter() { 43 super(); 44 } 45 46 public int category(Object element) { 47 if (element instanceof WizardCollectionElement){ 48 String id = ((WizardCollectionElement)element).getId(); 49 if (WizardsRegistryReader.GENERAL_WIZARD_CATEGORY.equals(id)) { 50 return 1; 51 } 52 if (WizardsRegistryReader.UNCATEGORIZED_WIZARD_CATEGORY.equals(id)) { 53 return 3; 54 } 55 return 2; 56 } 57 return super.category(element); 58 } 59 60 64 public boolean isSorterProperty(Object object, String propertyId) { 65 return propertyId.equals(IBasicPropertyConstants.P_TEXT); 66 } 67 } 68 | Popular Tags |