Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-02-25 08:33:13 +0000
committerEike Stepper2015-02-25 08:33:13 +0000
commit998a1909194b81dae4b0acbd72dc169c1a3b53a2 (patch)
tree20d6c988dde704278a8517d64e22fec68bbe0850 /plugins/org.eclipse.emf.cdo.ui
parent746c282c602274e6a2d67cecd966dde52a99e1b6 (diff)
downloadcdo-998a1909194b81dae4b0acbd72dc169c1a3b53a2.tar.gz
cdo-998a1909194b81dae4b0acbd72dc169c1a3b53a2.tar.xz
cdo-998a1909194b81dae4b0acbd72dc169c1a3b53a2.zip
[458349] Consolidate UI
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=458349
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
index a5531250a8..aee14aa025 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/ui/CDOItemProvider.java
@@ -17,10 +17,13 @@ import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.common.CDOCommonRepository.State;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchManager;
+import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.commit.CDOCommitInfo;
import org.eclipse.emf.cdo.common.model.CDOPackageRegistry;
import org.eclipse.emf.cdo.common.model.CDOPackageTypeRegistry;
import org.eclipse.emf.cdo.common.model.CDOPackageUnit.Type;
import org.eclipse.emf.cdo.common.security.CDOPermission;
+import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.eresource.CDOBinaryResource;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.CDOResourceFolder;
@@ -162,6 +165,14 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
}
/**
+ * @since 4.4
+ */
+ public boolean useFullPath(Object object)
+ {
+ return false;
+ }
+
+ /**
* @since 4.2
*/
public boolean isMergeMainBranchWithSession()
@@ -353,11 +364,35 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
{
if (obj instanceof CDOBranch)
{
+ if (useFullPath(obj))
+ {
+ return ((CDOBranch)obj).getPathName();
+ }
+
return ((CDOBranch)obj).getName();
}
+ if (obj instanceof CDOBranchPoint)
+ {
+ CDOBranchPoint branchPoint = (CDOBranchPoint)obj;
+ String result = getText(branchPoint.getBranch());
+
+ long timeStamp = branchPoint.getTimeStamp();
+ if (timeStamp != CDOBranchPoint.UNSPECIFIED_DATE)
+ {
+ result += " [" + CDOCommonUtil.formatTimeStamp(timeStamp) + "]";
+ }
+
+ return result;
+ }
+
if (obj instanceof CDOResourceNode)
{
+ if (useFullPath(obj))
+ {
+ return ((CDOResourceNode)obj).getPath();
+ }
+
return ((CDOResourceNode)obj).getName();
}
@@ -388,11 +423,27 @@ public class CDOItemProvider extends ContainerItemProvider<IContainer<Object>>
return getViewImage(view);
}
+ if (obj instanceof CDOCommitInfo)
+ {
+ return SharedIcons.getImage(SharedIcons.OBJ_COMMIT);
+ }
+
if (obj instanceof CDOBranch)
{
return SharedIcons.getImage(SharedIcons.OBJ_BRANCH);
}
+ if (obj instanceof CDOBranchPoint)
+ {
+ CDOBranchPoint branchPoint = (CDOBranchPoint)obj;
+ if (branchPoint.getTimeStamp() == CDOBranchPoint.UNSPECIFIED_DATE)
+ {
+ return SharedIcons.getImage(SharedIcons.OBJ_BRANCH);
+ }
+
+ return SharedIcons.getImage(SharedIcons.OBJ_BRANCH_POINT);
+ }
+
if (obj instanceof CDOResourceFolder)
{
return SharedIcons.getImage(SharedIcons.OBJ_RESOURCE_FOLDER);

Back to the top