diff options
author | james | 2002-06-11 21:44:59 +0000 |
---|---|---|
committer | james | 2002-06-11 21:44:59 +0000 |
commit | c57b359613d8590a5b9f6731f836726ebaba1796 (patch) | |
tree | a29ed39803af3473c77dcccaf7b1558198c845a9 | |
parent | 623badc11024e4a1efac2a6b7617abf6421e3d81 (diff) | |
download | eclipse.platform.team-c57b359613d8590a5b9f6731f836726ebaba1796.tar.gz eclipse.platform.team-c57b359613d8590a5b9f6731f836726ebaba1796.tar.xz eclipse.platform.team-c57b359613d8590a5b9f6731f836726ebaba1796.zip |
18609: Making un-added more obvious
-rw-r--r-- | bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java index 4ce371488..c7fb82b77 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSDecorationRunnable.java @@ -49,7 +49,9 @@ public class CVSDecorationRunnable implements Runnable { private static int checkedOutLocation; private static ImageDescriptor merged; private static int mergedLocation; - + private static ImageDescriptor newResource; + private static int newResourceLocation; + // Provides resources to be decorated and is notified when decoration has been calculated private IDecorationNotifier notifier; @@ -63,10 +65,13 @@ public class CVSDecorationRunnable implements Runnable { dirtyLocation = OverlayIcon.TOP_RIGHT; checkedIn = new CachedImageDescriptor(TeamImages.getImageDescriptor(ISharedImages.IMG_CHECKEDIN_OVR)); checkedInLocation = OverlayIcon.BOTTOM_RIGHT; - checkedOut = new CachedImageDescriptor(TeamImages.getImageDescriptor(ISharedImages.IMG_CHECKEDOUT_OVR)); + //checkedOut = new CachedImageDescriptor(TeamImages.getImageDescriptor(ISharedImages.IMG_CHECKEDOUT_OVR)); + checkedOut = new CachedImageDescriptor(TeamImages.getImageDescriptor(ISharedImages.IMG_CHECKEDIN_OVR)); checkedOutLocation = OverlayIcon.BOTTOM_RIGHT; merged = new CachedImageDescriptor(CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_MERGED)); mergedLocation = OverlayIcon.BOTTOM_RIGHT; + newResource = new CachedImageDescriptor(CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_QUESTIONABLE)); + newResourceLocation = OverlayIcon.BOTTOM_RIGHT; } /* @@ -288,7 +293,8 @@ public class CVSDecorationRunnable implements Runnable { boolean showDirty = store.getBoolean(ICVSUIConstants.PREF_SHOW_DIRTY_DECORATION); boolean showHasRemote = store.getBoolean(ICVSUIConstants.PREF_SHOW_HASREMOTE_DECORATION); boolean showAdded = store.getBoolean(ICVSUIConstants.PREF_SHOW_ADDED_DECORATION); - + boolean showNewResources = store.getBoolean(ICVSUIConstants.PREF_SHOW_NEWRESOURCE_DECORATION); + if (showAdded && resource.getType() == IResource.FILE) { try { IPath location = resource.getLocation(); @@ -322,7 +328,30 @@ public class CVSDecorationRunnable implements Runnable { overlays.add(checkedIn); locations.add(new Integer(checkedInLocation)); } - + + // show newResource icon + if (showNewResources) { + ICVSResource cvsResource = CVSWorkspaceRoot.getCVSResourceFor(resource); + try { + if (cvsResource.exists()) { + boolean isNewResource = false; + if (cvsResource.isFolder()) { + if (!((ICVSFolder)cvsResource).isCVSFolder()) { + isNewResource = true; + } + } else if (!cvsResource.isManaged()) { + isNewResource = true; + } + if (isNewResource) { + overlays.add(newResource); + locations.add(new Integer(newResourceLocation)); + } + } + } catch (CVSException e) { + CVSUIPlugin.log(e.getStatus()); + } + } + if (!overlays.isEmpty()) { Integer[] integers = (Integer[])locations.toArray(new Integer[locations.size()]); int[] ints = new int[integers.length]; |