1 11 package org.eclipse.team.internal.ui.synchronize; 12 13 import org.eclipse.compare.structuremergeviewer.IDiffContainer; 14 import org.eclipse.core.resources.IResource; 15 import org.eclipse.jface.resource.ImageDescriptor; 16 import org.eclipse.team.internal.core.subscribers.ChangeSet; 17 import org.eclipse.team.internal.ui.ITeamUIImages; 18 import org.eclipse.team.internal.ui.TeamUIPlugin; 19 20 23 public class ChangeSetDiffNode extends SynchronizeModelElement { 24 25 private final ChangeSet set; 26 27 public ChangeSetDiffNode(IDiffContainer parent, ChangeSet set) { 28 super(parent); 29 this.set = set; 30 } 31 32 35 public IResource getResource() { 36 return null; 37 } 38 39 public ChangeSet getSet() { 40 return set; 41 } 42 43 46 public ImageDescriptor getImageDescriptor(Object object) { 47 return TeamUIPlugin.getImageDescriptor(ITeamUIImages.IMG_CHANGE_SET); 48 } 49 50 53 public String getName() { 54 return set.getName(); 55 } 56 57 60 public String toString() { 61 return getName(); 62 } 63 64 67 public int hashCode() { 68 return set.hashCode(); 69 } 70 71 74 public boolean equals(Object object) { 75 if (object instanceof ChangeSetDiffNode) { 76 return((ChangeSetDiffNode)object).getSet() == set; 77 } 78 return super.equals(object); 79 } 80 81 84 public Object getAdapter(Class adapter) { 85 if (adapter.equals(ChangeSet.class)) { 86 return set; 87 } 88 return super.getAdapter(adapter); 89 } 90 } 91 | Popular Tags |