X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.tmf.ui%2Fsrc%2Forg%2Feclipse%2Flinuxtools%2Ftmf%2Fui%2Fwidgets%2Ftimegraph%2Fwidgets%2FTimeGraphTooltipHandler.java;h=0eba3d26816e2decdfb4ed7a78941f7956932958;hb=026664b7c5225982ed5a02d370f7df8c485e0148;hp=595675067568ee48b2d3f83df4ccf072a7cb3d37;hpb=e6809677b02f3626d55b175b1d6e2b814ba5b44a;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphTooltipHandler.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphTooltipHandler.java index 5956750675..0eba3d2681 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphTooltipHandler.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/widgets/timegraph/widgets/TimeGraphTooltipHandler.java @@ -1,3 +1,4 @@ + /***************************************************************************** * Copyright (c) 2007 Intel Corporation, 2009, 2012 Ericsson. * All rights reserved. This program and the accompanying materials @@ -14,6 +15,7 @@ *****************************************************************************/ package org.eclipse.linuxtools.tmf.ui.widgets.timegraph.widgets; +import java.text.NumberFormat; import java.util.Iterator; import java.util.Map; @@ -206,43 +208,33 @@ public class TimeGraphTooltipHandler { } Resolution res = Resolution.NANOSEC; - if (_timeDataProvider.isCalendarFormat()) { + TimeFormat tf = _timeDataProvider.getTimeFormat(); + if (tf == TimeFormat.CALENDAR) { addItem(Messages.TmfTimeTipHandler_TRACE_DATE, eventStartTime > -1 ? Utils.formatDate(eventStartTime) : "?"); //$NON-NLS-1$ - if (eventDuration > 0) { - addItem(Messages.TmfTimeTipHandler_TRACE_START_TIME, eventStartTime > -1 ? - Utils.formatTime(eventStartTime, TimeFormat.ABSOLUTE, res) - : "?"); //$NON-NLS-1$ - - addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME, eventEndTime > -1 ? - Utils.formatTime(eventEndTime, TimeFormat.ABSOLUTE, res) - : "?"); //$NON-NLS-1$ - } else { - addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME, eventStartTime > -1 ? - Utils.formatTime(eventStartTime, TimeFormat.ABSOLUTE, res) - : "?"); //$NON-NLS-1$ - } + } + if (eventDuration > 0) { + addItem(Messages.TmfTimeTipHandler_TRACE_START_TIME, eventStartTime > -1 ? + Utils.formatTime(eventStartTime, tf, res) + : "?"); //$NON-NLS-1$ + + addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME, eventEndTime > -1 ? + Utils.formatTime(eventEndTime, tf, res) + : "?"); //$NON-NLS-1$ } else { - if (eventDuration > 0) { - addItem(Messages.TmfTimeTipHandler_TRACE_START_TIME, eventStartTime > -1 ? - Utils.formatTime(eventStartTime, TimeFormat.RELATIVE, res) - : "?"); //$NON-NLS-1$ - - addItem(Messages.TmfTimeTipHandler_TRACE_STOP_TIME, eventEndTime > -1 ? - Utils.formatTime(eventEndTime, TimeFormat.RELATIVE, res) - : "?"); //$NON-NLS-1$ - } else { - addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME, eventStartTime > -1 ? - Utils.formatTime(eventStartTime, TimeFormat.RELATIVE, res) - : "?"); //$NON-NLS-1$ - } + addItem(Messages.TmfTimeTipHandler_TRACE_EVENT_TIME, eventStartTime > -1 ? + Utils.formatTime(eventStartTime, tf, res) + : "?"); //$NON-NLS-1$ } if (eventDuration > 0) { // Duration in relative format in any case + if (tf == TimeFormat.CALENDAR) { + tf = TimeFormat.RELATIVE; + } addItem(Messages.TmfTimeTipHandler_DURATION, eventDuration > -1 ? - Utils.formatTime(eventDuration, TimeFormat.RELATIVE, res) + Utils.formatTime(eventDuration, tf, res) : "?"); //$NON-NLS-1$ } }