Skip to content

Commit

Permalink
Bug 579875: Set the ScriptedXYView title to the DP name
Browse files Browse the repository at this point in the history
Change-Id: I30cc11001f92c879de58e150bb98237b1870adcc
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/193302
Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org>
Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
  • Loading branch information
bhufmann committed May 16, 2022
1 parent 43838ed commit c3ef67f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Expand Up @@ -35,7 +35,6 @@
import org.eclipse.tracecompass.statesystem.core.statevalue.ITmfStateValue;
import org.eclipse.tracecompass.tmf.core.analysis.IAnalysisModule;
import org.eclipse.tracecompass.tmf.core.analysis.TmfAbstractAnalysisModule;
import org.eclipse.tracecompass.tmf.core.component.DataProviderConstants;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphArrow;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphDataProvider;
import org.eclipse.tracecompass.tmf.core.model.timegraph.ITimeGraphEntryModel;
Expand Down Expand Up @@ -369,7 +368,7 @@ public class DataProviderScriptingModule {
DataDrivenOutputEntry entry = new DataDrivenOutputEntry(Collections.emptyList(), path, null, true,
display, id, parent, name, displayType);

ITmfTreeXYDataProvider<ITmfTreeDataModel> provider = DataDrivenXYProviderFactory.create(trace, stateSystems, Collections.singletonList(entry), ScriptingDataProviderManager.PROVIDER_ID + DataProviderConstants.ID_SEPARATOR + analysisName);
ITmfTreeXYDataProvider<ITmfTreeDataModel> provider = DataDrivenXYProviderFactory.create(trace, stateSystems, Collections.singletonList(entry), ScriptingDataProviderManager.createProviderId(analysisName));
ScriptingDataProviderManager.getInstance().registerDataProvider(trace, provider);
return provider;
}
Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019 École Polytechnique de Montréal
* Copyright (c) 2019, 2022 École Polytechnique de Montréal and others
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
Expand All @@ -16,6 +16,8 @@
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tracecompass.common.core.NonNullUtils;
import org.eclipse.tracecompass.incubator.internal.scripting.core.data.provider.ScriptingDataProviderManager;
import org.eclipse.tracecompass.tmf.core.component.DataProviderConstants;
import org.eclipse.tracecompass.tmf.ui.viewers.TmfViewer;
import org.eclipse.tracecompass.tmf.ui.viewers.xychart.TmfXYChartViewer;
Expand Down Expand Up @@ -48,6 +50,15 @@ public ScriptedXYView() {
super(Messages.ScriptedXYTreeViewer_DefaultTitle);
}

@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
String title = ScriptingDataProviderManager.extractProviderName(NonNullUtils.nullToEmptyString(getSecondaryIdName()));
if (title != null) {
setPartName(title);
}
}

@Override
protected TmfXYChartViewer createChartViewer(Composite parent) {
TmfXYChartSettings settings = new TmfXYChartSettings(Messages.ScriptedXYTreeViewer_DefaultViewerTitle,
Expand Down

0 comments on commit c3ef67f

Please sign in to comment.