1 11 package org.eclipse.debug.internal.ui.views.breakpoints; 12 13 import java.util.HashMap ; 14 import java.util.Map ; 15 16 import org.eclipse.core.runtime.IAdaptable; 17 import org.eclipse.core.runtime.PlatformObject; 18 import org.eclipse.debug.internal.ui.DebugPluginImages; 19 import org.eclipse.debug.ui.IDebugUIConstants; 20 import org.eclipse.jface.resource.ImageDescriptor; 21 import org.eclipse.ui.model.IWorkbenchAdapter; 22 23 26 public class OtherBreakpointCategory extends PlatformObject implements IWorkbenchAdapter { 27 28 private static Map fOthers = new HashMap (); 29 private IBreakpointOrganizer fOrganizer; 30 31 32 public static IAdaptable[] getCategories(IBreakpointOrganizer organizer) { 33 IAdaptable[] others = (IAdaptable[]) fOthers.get(organizer); 34 if (others == null) { 35 others = new IAdaptable[]{new OtherBreakpointCategory(organizer)}; 36 fOthers.put(organizer, others); 37 } 38 return others; 39 } 40 41 46 private OtherBreakpointCategory(IBreakpointOrganizer organizer) { 47 fOrganizer = organizer; 48 } 49 50 53 public Object [] getChildren(Object o) { 54 return null; 55 } 56 57 60 public ImageDescriptor getImageDescriptor(Object object) { 61 return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_VIEW_BREAKPOINTS); 62 } 63 64 67 public String getLabel(Object o) { 68 return fOrganizer.getOthersLabel(); 69 } 70 71 74 public Object getParent(Object o) { 75 return null; 76 } 77 78 81 public boolean equals(Object obj) { 82 if (obj instanceof OtherBreakpointCategory) { 83 OtherBreakpointCategory category = (OtherBreakpointCategory) obj; 84 return fOrganizer.equals(category.fOrganizer); 85 } 86 return false; 87 } 88 89 92 public int hashCode() { 93 return fOrganizer.hashCode(); 94 } 95 } 96 | Popular Tags |