Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-10-12 06:02:17 +0000
committerEike Stepper2015-10-12 06:02:17 +0000
commitd2c2204b5bf92ffe094b3265de57e005cb634596 (patch)
tree28a9ea897a24829a214849da00a51864a1834539
parentdda834df979f1d9f58a9e56cdb83ff9ed7dde267 (diff)
downloadcdo-d2c2204b5bf92ffe094b3265de57e005cb634596.tar.gz
cdo-d2c2204b5bf92ffe094b3265de57e005cb634596.tar.xz
cdo-d2c2204b5bf92ffe094b3265de57e005cb634596.zip
[Releng] Enhance timestamp formatting in CDOServerBrowser
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerBrowser.java21
2 files changed, 25 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
index d62c9fb7b2..3fc114499c 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOCommonUtil.java
@@ -53,6 +53,11 @@ import java.util.regex.Pattern;
public final class CDOCommonUtil
{
/**
+ * @since 4.5
+ */
+ public static final String UNSPECIFIED_DATE_STRING = "*";
+
+ /**
* @since 4.0
*/
public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss'.'SSS");
@@ -226,7 +231,7 @@ public final class CDOCommonUtil
{
if (timeStamp == CDORevision.UNSPECIFIED_DATE)
{
- return "*";
+ return UNSPECIFIED_DATE_STRING;
}
synchronized (DATE_FORMAT)
@@ -242,7 +247,7 @@ public final class CDOCommonUtil
{
String trimmed = timeStamp.trim();
- if ("*".equals(trimmed))
+ if (UNSPECIFIED_DATE_STRING.equals(trimmed))
{
return CDORevision.UNSPECIFIED_DATE;
}
diff --git a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerBrowser.java b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerBrowser.java
index a7257f3a56..e9395aa534 100644
--- a/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerBrowser.java
+++ b/plugins/org.eclipse.emf.cdo.server/src/org/eclipse/emf/cdo/server/CDOServerBrowser.java
@@ -418,6 +418,21 @@ public class CDOServerBrowser extends Worker
}
/**
+ * @since 4.5
+ */
+ public static String formatTimeStamp(long timeStamp)
+ {
+ String str = CDOCommonUtil.formatTimeStamp(timeStamp);
+ if (!CDOCommonUtil.UNSPECIFIED_DATE_STRING.equals(str))
+ {
+ str += " - " + timeStamp;
+ str = str.replaceAll(" ", " ");
+ }
+
+ return str;
+ }
+
+ /**
* A {@link CDOServerBrowser server browser} for the repositories in a {@link IManagedContainer managed container}.
*
* @author Eike Stepper
@@ -897,7 +912,7 @@ public class CDOServerBrowser extends Worker
className = StringUtil.replace(className, new String[] { "(", ")", "," }, new String[] { "<br>", "", "<br>" });
className = className.substring("<br>".length() + 1);
- String created = CDOCommonUtil.formatTimeStamp(revision.getTimeStamp());
+ String created = formatTimeStamp(revision.getTimeStamp());
String commitInfo = browser.href(created, HistoryPage.NAME, "time", String.valueOf(revision.getTimeStamp()));
pout.print("<table border=\"1\" cellpadding=\"2\">\r\n");
@@ -907,7 +922,7 @@ public class CDOServerBrowser extends Worker
showKeyValue(pout, true, "branch", revision.getBranch().getName() + "[" + revision.getBranch().getID() + "]");
showKeyValue(pout, true, "version", revision.getVersion());
showKeyValue(pout, true, "created", commitInfo);
- showKeyValue(pout, true, "revised", CDOCommonUtil.formatTimeStamp(revision.getRevised()));
+ showKeyValue(pout, true, "revised", formatTimeStamp(revision.getRevised()));
if (revision instanceof SyntheticCDORevision)
{
if (revision instanceof PointerCDORevision)
@@ -1329,7 +1344,7 @@ public class CDOServerBrowser extends Worker
String timeStamp = String.valueOf(commitInfo.getTimeStamp());
boolean selected = timeStamp.equals(param);
- String formatted = CDOCommonUtil.formatTimeStamp(commitInfo.getTimeStamp()).replaceAll(" ", "&nbsp;");
+ String formatted = formatTimeStamp(commitInfo.getTimeStamp());
String label = formatted;
if (!selected && auditing)
{

Back to the top