From b262000afa1269fd93511e69cf8d895424c72166 Mon Sep 17 00:00:00 2001 From: Alexander Fedorov Date: Thu, 26 Sep 2024 12:42:45 +0300 Subject: [PATCH] [#1417] Plug-in editor: Runtime tab should show selected package The simplest solution would be to use the section description --- .../plugin/ExportPackageVisibilitySection.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageVisibilitySection.java b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageVisibilitySection.java index 0fbc87beae..403598212a 100644 --- a/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageVisibilitySection.java +++ b/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/ExportPackageVisibilitySection.java @@ -19,7 +19,11 @@ import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Collectors; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuManager; @@ -373,6 +377,15 @@ private void update(ExportPackageObject[] objects) { getTablePart().setButtonEnabled(1, fInternalButton.getSelection() && isEditable()); fFriendViewer.setInput(object); fBlockChanges = false; + getSection().setDescription(Optional.ofNullable(objects).map(this::description) + .orElse(PDEUIMessages.ExportPackageVisibilitySection_default)); + } + + private String description(ExportPackageObject[] packages) { + return Arrays.stream(packages)// + .filter(Objects::nonNull)// + .map(ExportPackageObject::getName) + .collect(Collectors.joining(", ")); //$NON-NLS-1$ } private BundleInputContext getBundleContext() {