/*******************************************************************************
- * Copyright (c) 2010, 2014 Ericsson
+ * Copyright (c) 2010, 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import org.eclipse.tracecompass.internal.tmf.ui.Activator;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.filter.ITmfFilter;
+import org.eclipse.tracecompass.tmf.core.resources.ITmfMarker;
/**
* Provider for decorations in the time chart view
}
for (IMarker bookmark : fBookmarksFile.findMarkers(
IMarker.BOOKMARK, false, IResource.DEPTH_ZERO)) {
- int location = bookmark.getAttribute(IMarker.LOCATION, -1);
- if (location != -1) {
- Long rank = (long) location;
+ /* try location as an integer for backward compatibility */
+ long rank = bookmark.getAttribute(IMarker.LOCATION, -1);
+ if (rank == -1) {
+ String rankString = bookmark.getAttribute(ITmfMarker.MARKER_RANK, (String) null);
+ try {
+ rank = Long.parseLong(rankString);
+ } catch (NumberFormatException e) {
+ /* ignored */
+ }
+ }
+ if (rank != -1) {
fBookmarksSet.add(rank);
}
}
/*******************************************************************************
- * Copyright (c) 2010, 2015 Ericsson
+ * Copyright (c) 2010, 2016 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
+import org.eclipse.tracecompass.tmf.core.resources.ITmfMarker;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventFilterAppliedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfEventSearchAppliedSignal;
import org.eclipse.tracecompass.tmf.core.signal.TmfSelectionRangeUpdatedSignal;
for (IMarkerDelta delta : event.findMarkerDeltas(IMarker.BOOKMARK, false)) {
for (TimeChartDecorationProvider provider : fDecorationProviders.values()) {
if (delta.getResource().equals(provider.getBookmarksFile())) {
- if (delta.getKind() == IResourceDelta.CHANGED && delta.getMarker().getAttribute(IMarker.LOCATION, -1) != -1) {
- provider.refreshBookmarks();
- } else if (delta.getKind() == IResourceDelta.REMOVED) {
+ if (delta.getKind() == IResourceDelta.REMOVED ||
+ delta.getMarker().getAttribute(IMarker.LOCATION, -1) != -1 ||
+ delta.getMarker().getAttribute(ITmfMarker.MARKER_RANK, (String) null) != null) {
provider.refreshBookmarks();
}
}