Skip to content

Commit

Permalink
Bug 579875: Set the ScriptedHistogramView title to the DP name
Browse files Browse the repository at this point in the history
Change-Id: I566754df55b5f4e49902c3199145a6dffff8608c
Signed-off-by: Bernd Hufmann <bernd.hufmann@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/193303
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 c3ef67f commit 07234d4
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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 @@ -49,6 +50,15 @@ public ScriptedHistogramView() {
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.ScriptedHistogramTreeViewer_DefaultViewerTitle, Messages.ScriptedHistogramTreeViewer_DefaultXAxis, Messages.ScriptedHistogramTreeViewer_DefaultYAxis, 1);
Expand Down

0 comments on commit 07234d4

Please sign in to comment.