Skip to content

Commit

Permalink
Fix open with in Data Explorer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Jul 28, 2023
1 parent 548b56c commit 5358d32
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.io.IOException;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -282,7 +281,6 @@ private void createContextMenu(DataExplorerTreeUI treeUI) {
public void menuAboutToShow(IMenuManager mgr) {

Object[] selection = treeViewer.getStructuredSelection().toArray();
Map<File, Map<ISupplierFileIdentifier, Collection<ISupplier>>> converterSupplier = new HashMap<>();
Set<ISupplier> supplierSet = new TreeSet<>(new Comparator<ISupplier>() {

@Override
Expand Down Expand Up @@ -325,20 +323,15 @@ public void run() {
@Override
public void run() {

outer:
for(Object object : selection) {
if(object instanceof File file) {
Map<ISupplierFileIdentifier, Collection<ISupplier>> map = converterSupplier.get(file);
if(map == null) {
continue;
}
for(Entry<ISupplierFileIdentifier, Collection<ISupplier>> entry : map.entrySet()) {
Map<ISupplierFileIdentifier, Collection<ISupplier>> identifiers = getIdentifierSupplier().apply(file);
for(Entry<ISupplierFileIdentifier, Collection<ISupplier>> entry : identifiers.entrySet()) {
ISupplierFileIdentifier identifier = entry.getKey();
if(identifier instanceof ISupplierFileEditorSupport supplierFileEditorSupport) {
for(ISupplier supplier : entry.getValue()) {
if(activeFileSupplier.getId().equals(supplier.getId())) {
openEditorWithSupplier(file, supplierFileEditorSupport, supplier);
continue outer;
}
}
}
Expand Down

0 comments on commit 5358d32

Please sign in to comment.