From 5358d32b54aa70738fda4e99a4e754dc54b4fdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 28 Jul 2023 12:54:10 +0200 Subject: [PATCH] Fix open with in Data Explorer. --- .../ux/extension/ui/swt/MultiDataExplorerTreeUI.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.ui/src/org/eclipse/chemclipse/ux/extension/ui/swt/MultiDataExplorerTreeUI.java b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.ui/src/org/eclipse/chemclipse/ux/extension/ui/swt/MultiDataExplorerTreeUI.java index 87dc3903a6..dfb5b82d37 100644 --- a/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.ui/src/org/eclipse/chemclipse/ux/extension/ui/swt/MultiDataExplorerTreeUI.java +++ b/chemclipse/plugins/org.eclipse.chemclipse.ux.extension.ui/src/org/eclipse/chemclipse/ux/extension/ui/swt/MultiDataExplorerTreeUI.java @@ -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; @@ -282,7 +281,6 @@ private void createContextMenu(DataExplorerTreeUI treeUI) { public void menuAboutToShow(IMenuManager mgr) { Object[] selection = treeViewer.getStructuredSelection().toArray(); - Map>> converterSupplier = new HashMap<>(); Set supplierSet = new TreeSet<>(new Comparator() { @Override @@ -325,20 +323,15 @@ public void run() { @Override public void run() { - outer: for(Object object : selection) { if(object instanceof File file) { - Map> map = converterSupplier.get(file); - if(map == null) { - continue; - } - for(Entry> entry : map.entrySet()) { + Map> identifiers = getIdentifierSupplier().apply(file); + for(Entry> 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; } } }