Skip to content

Commit

Permalink
[#1417] Plug-in editor: Runtime tab should show selected package
Browse files Browse the repository at this point in the history
The simplest solution would be to use the section description
  • Loading branch information
ruspl-afed committed Sep 27, 2024
1 parent f7070db commit 3ce3a57
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 3ce3a57

Please sign in to comment.