~piastucki/bzr-eclipse/convert-lightweight-checkouts

« back to all changes in this revision

Viewing changes to org.vcs.bazaar.eclipse.ui/src/org/vcs/bazaar/eclipse/ui/widgets/BzrResourceSelectionStatusLabelProvider.java

  • Committer: Piotr Piastucki
  • Date: 2013-09-25 11:44:07 UTC
  • Revision ID: piotr_piastucki-20130925114407-tcvktn3208u5vrd3
Improve renames detection in resource selection and status view

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
import org.eclipse.jface.viewers.DecorationOverlayIcon;
16
16
import org.eclipse.jface.viewers.IDecoration;
17
17
import org.eclipse.swt.graphics.Image;
 
18
import org.vcs.bazaar.client.BazaarStatusKind;
 
19
import org.vcs.bazaar.eclipse.core.model.BzrStatus;
18
20
import org.vcs.bazaar.eclipse.core.model.IBzrResourceStatus;
19
21
import org.vcs.bazaar.eclipse.ui.decorator.DecoratorImages;
20
22
 
29
31
        public Image getImage(Object obj) {
30
32
                IBzrResourceStatus status = (IBzrResourceStatus) obj;
31
33
                Image base = CompareUI.getImage(status.getStatus().getPath());
32
 
                if (status.isAdded() 
 
34
                if (status.isRenamed()) {
 
35
                        ImageDescriptor im =  new DecorationOverlayIcon(base, DecoratorImages.getImageDescriptor(new BzrStatus(BazaarStatusKind.RENAMED)), IDecoration.BOTTOM_RIGHT);
 
36
                        base = (Image) resourceManager.get(im);
 
37
                } else if (status.isAdded() 
33
38
                        || status.isDeleted() 
34
39
                        || status.isUnknown()
35
 
                        || status.isRenamed()
36
40
                        || status.isHasConflicts()) {
37
41
                        ImageDescriptor im =  new DecorationOverlayIcon(base, DecoratorImages.getImageDescriptor(status.getStatus()), IDecoration.BOTTOM_RIGHT);
38
42
                        base = (Image) resourceManager.get(im);