Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 60682 Details for
Bug 161620
Time Zone discrepancy in Log View for Java XML Logging File
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch which synchronizes time zones between views
161620_patch.txt (text/plain), 10.01 KB, created by
Liz Dancy
on 2007-03-13 11:53:43 EDT
(
hide
)
Description:
Patch which synchronizes time zones between views
Filename:
MIME Type:
Creator:
Liz Dancy
Created:
2007-03-13 11:53:43 EDT
Size:
10.01 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.log.views >Index: src/org/eclipse/hyades/sd/logc/internal/loader/LogInteractions.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.log.views/src/org/eclipse/hyades/sd/logc/internal/loader/LogInteractions.java,v >retrieving revision 1.47 >diff -u -r1.47 LogInteractions.java >--- src/org/eclipse/hyades/sd/logc/internal/loader/LogInteractions.java 13 Sep 2006 15:40:20 -0000 1.47 >+++ src/org/eclipse/hyades/sd/logc/internal/loader/LogInteractions.java 13 Mar 2007 15:13:37 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005,2006 IBM Corporation and others. >+ * Copyright (c) 2005,2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -1649,6 +1649,7 @@ > / TIME_CONVERSION_FACTOR); > node.setEndTime(CBEUtils.computeAdjustedCreationTime(object) > / TIME_CONVERSION_FACTOR); >+ node.setTimeZone(); > > } else > { >@@ -1677,6 +1678,7 @@ > node.setEndTime(CBEUtils > .computeAdjustedCreationTime(object) > / TIME_CONVERSION_FACTOR); >+ node.setTimeZone(); > > } else > { >@@ -1698,6 +1700,7 @@ > parentNode.addElement(object); > parentNode.setExpanded(true); > parentNode.setBackgroundColor(); >+ parentNode.setTimeZone(); > if (parentNode.getHotSpot() == null) > { > hotSpotNode = new LogHotSpot(); >@@ -1712,6 +1715,7 @@ > node.setEndTime(CBEUtils > .computeAdjustedCreationTime(object) > / TIME_CONVERSION_FACTOR); >+ node.setTimeZone(); > } > > } else >@@ -1742,6 +1746,7 @@ > node.setEndTime(CBEUtils > .computeAdjustedCreationTime(object) > / TIME_CONVERSION_FACTOR); >+ node.setTimeZone(); > > } else > { >@@ -1765,6 +1770,7 @@ > .setEndTime(CBEUtils > .computeAdjustedCreationTime(object) > / TIME_CONVERSION_FACTOR); >+ node.setTimeZone(); > > } else > { >@@ -1807,6 +1813,7 @@ > .setEndTime(CBEUtils > .computeAdjustedCreationTime(object) > / TIME_CONVERSION_FACTOR); >+ node.setTimeZone(); > } > } > } >@@ -1825,6 +1832,7 @@ > node.setEndTime(CBEUtils > .computeAdjustedCreationTime(object) > / TIME_CONVERSION_FACTOR); >+ node.setTimeZone(); > > } > } >@@ -1842,6 +1850,7 @@ > / TIME_CONVERSION_FACTOR); > node.setEndTime(CBEUtils.computeAdjustedCreationTime(object) > / TIME_CONVERSION_FACTOR); >+ node.setTimeZone(); > > } > >Index: src/org/eclipse/hyades/sd/logc/internal/uml2sd/LogGraphNode.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.log.views/src/org/eclipse/hyades/sd/logc/internal/uml2sd/LogGraphNode.java,v >retrieving revision 1.13 >diff -u -r1.13 LogGraphNode.java >--- src/org/eclipse/hyades/sd/logc/internal/uml2sd/LogGraphNode.java 20 Sep 2006 19:03:44 -0000 1.13 >+++ src/org/eclipse/hyades/sd/logc/internal/uml2sd/LogGraphNode.java 13 Mar 2007 15:13:37 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -19,8 +19,13 @@ > import org.eclipse.emf.ecore.EObject; > import org.eclipse.hyades.models.cbe.CBECommonBaseEvent; > import org.eclipse.hyades.sd.logc.internal.util.LogcUtil; >+import org.eclipse.hyades.ui.internal.util.PreferencesUtil; > import org.eclipse.hyades.uml2sd.ui.core.ExecutionOccurrence; >+import org.eclipse.hyades.uml2sd.ui.core.ITimeRange2; > import org.eclipse.hyades.uml2sd.ui.core.internal.HotSpot; >+import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.tptp.platform.log.views.internal.LogViewsPlugin; >+import org.eclipse.tptp.platform.log.views.internal.util.LogUIConstants; > import org.eclipse.ui.IActionFilter; > > /** >@@ -29,12 +34,13 @@ > * To change the template for this generated type comment go to > * Window - Preferences - Java - Code Generation - Code and Comments > */ >-public class LogGraphNode extends ExecutionOccurrence implements IActionFilter { >+public class LogGraphNode extends ExecutionOccurrence implements IActionFilter, ITimeRange2 { > > private EObject element; > private List elements = null; > private boolean expanded = false; > private HotSpot hotSpot = null; >+ private int timeZoneOffset = 0; > > protected LogGraphNode(){ > } >@@ -68,6 +74,7 @@ > } > > public void setBackgroundColor(){ >+ > short sev=0; > if(!hasElements() || isExpanded()){ > sev = ((CBECommonBaseEvent)element).getSeverity(); >@@ -145,4 +152,21 @@ > public HotSpot getHotSpot(){ > return hotSpot; > } >+ >+ public int getTimeZone(){ >+ if (timeZoneOffset != 0){ >+ return timeZoneOffset; >+ } >+ else { >+ CBECommonBaseEvent cbe = (CBECommonBaseEvent)this.element; >+ return cbe.getTimeZone(); >+ } >+ >+ } >+ public void setTimeZone() >+ { >+ IPreferenceStore store = LogViewsPlugin.getDefault().getPreferenceStore(); >+ String timeZone= PreferencesUtil.TIME_ZONE_LIST_OFFSET[store.getInt(LogUIConstants.LA_TZ)]; >+ timeZoneOffset = com.ibm.icu.util.TimeZone.getTimeZone(timeZone).getRawOffset(); >+ } > } >#P org.eclipse.tptp.platform.common.ui >Index: src-uml2sd/org/eclipse/hyades/uml2sd/ui/view/SDWidget.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.common.ui/src-uml2sd/org/eclipse/hyades/uml2sd/ui/view/SDWidget.java,v >retrieving revision 1.1 >diff -u -r1.1 SDWidget.java >--- src-uml2sd/org/eclipse/hyades/uml2sd/ui/view/SDWidget.java 16 Aug 2006 21:15:32 -0000 1.1 >+++ src-uml2sd/org/eclipse/hyades/uml2sd/ui/view/SDWidget.java 13 Mar 2007 15:13:37 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2006 IBM Corporation and others. >+ * Copyright (c) 2005, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -12,9 +12,12 @@ > package org.eclipse.hyades.uml2sd.ui.view; > > >+import java.text.DateFormat; > import java.util.ArrayList; > import java.util.Date; > import java.util.List; >+import java.util.SimpleTimeZone; >+import java.util.TimeZone; > import java.util.Timer; > import java.util.TimerTask; > >@@ -25,6 +28,7 @@ > import org.eclipse.hyades.uml2sd.ui.core.Frame; > import org.eclipse.hyades.uml2sd.ui.core.GraphNode; > import org.eclipse.hyades.uml2sd.ui.core.ITimeRange; >+import org.eclipse.hyades.uml2sd.ui.core.ITimeRange2; > import org.eclipse.hyades.uml2sd.ui.core.Lifeline; > import org.eclipse.hyades.uml2sd.ui.core.Metrics; > import org.eclipse.hyades.uml2sd.ui.core.SyncMessage; >@@ -75,11 +79,11 @@ > import org.eclipse.swt.widgets.MenuItem; > import org.eclipse.ui.part.ViewPart; > >-import com.ibm.icu.text.DateFormat; > import com.ibm.icu.text.MessageFormat; > > > >+ > /** > * > * @author sveyrier >@@ -655,11 +659,21 @@ > } > else > { >- if (toolTipNode instanceof ITimeRange) >+ if (toolTipNode instanceof ITimeRange2) > { >+ // if it is an instance of ITimeRange2 then it must be also an instance of ITimeRange >+ // but not necessarily the converse >+ // This section was modified to use the getTimeZone vlaues from ITimeRange2 >+ // defect 161620 >+ // Liz Dancy >+ int zoneRawOffset = ((ITimeRange2)toolTipNode).getTimeZone(); >+ TimeZone timeZone = new SimpleTimeZone(zoneRawOffset, ""); >+ timeZone.setRawOffset(zoneRawOffset); >+ DateFormat dateTimeFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM); >+ dateTimeFormat.setTimeZone(timeZone); > double tt = ((ITimeRange)toolTipNode).getLastTime()*1000; > Date timeDate = new Date ((long)tt); >- String time=DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM).format(timeDate); >+ String time= dateTimeFormat.format(timeDate); > // if (agent.getStartTime() > 0) > // { > // Date date = new Date((long)agent.getStartTime() * 1000); >Index: src-uml2sd/org/eclipse/hyades/uml2sd/ui/core/ITimeRange2.java >=================================================================== >RCS file: src-uml2sd/org/eclipse/hyades/uml2sd/ui/core/ITimeRange2.java >diff -N src-uml2sd/org/eclipse/hyades/uml2sd/ui/core/ITimeRange2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-uml2sd/org/eclipse/hyades/uml2sd/ui/core/ITimeRange2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,24 @@ >+/********************************************************************** >+ * Copyright (c) 2007 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * $Id: GraphNode.java,v 1.2 2006/09/20 20:56:25 ewchan Exp $ >+ * >+ * Contributors: >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+ >+package org.eclipse.hyades.uml2sd.ui.core; >+/** >+ * An interface added to synchronize the Log Interactions View time zone >+ * with the Log View time zone for each LogGraphNode. >+ * @author ldancy >+ */ >+public interface ITimeRange2 >+{ >+ public int getTimeZone(); >+ >+ public void setTimeZone(); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 161620
:
52515
|
52557
| 60682