Skip to content

Commit

Permalink
Bug 579875: Set the ScriptedScatterView title to the DP name
Browse files Browse the repository at this point in the history
Change-Id: Idd410023967dd7ccc9d5a080bc1eb17cffed24d3
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/193304
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 07234d4 commit bf70416
Showing 1 changed file with 12 additions and 2 deletions.
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 VMware, Inc.
* Copyright (c) 2020, 2022 VMware, Inc 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,7 +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.incubator.internal.scripting.ui.views.xychart.ScriptedXYTreeViewer;
import org.eclipse.tracecompass.tmf.core.component.DataProviderConstants;
import org.eclipse.tracecompass.tmf.ui.viewers.TmfViewer;
Expand Down Expand Up @@ -50,6 +51,15 @@ public ScriptedScatterView() {
super(ID);
}

@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.ScriptedScatterTreeViewer_DefaultViewerTitle, Messages.ScriptedScatterTreeViewer_DefaultXAxis, Messages.ScriptedScatterTreeViewer_DefaultYAxis, 1);
Expand Down

0 comments on commit bf70416

Please sign in to comment.