Skip to content

Commit

Permalink
[eclipse-pde#1417] Plug-in editor: Runtime tab should show selected p…
Browse files Browse the repository at this point in the history
…ackage

The simplest solution would be to use the section description
  • Loading branch information
ruspl-afed committed Sep 28, 2024
1 parent 3f973e8 commit b262000
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit b262000

Please sign in to comment.