Refactor generic "open in..." framework
[taxeditor.git] / eu.etaxonomy.taxeditor.store / src / main / java / eu / etaxonomy / taxeditor / view / CdmViewerChooser.java
index 939f753b698d3874cd784a9a863c1d43c886c09b..09f3784042fbbc3cd5f4476c1f55c12aefc5968f 100644 (file)
@@ -48,7 +48,7 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  */
 public class CdmViewerChooser extends PopupDialog implements ISelectionChangedListener, ILabelProvider{
 
-    private Map<String, String> nameViewerMap;
+    private Map<Command, String> nameViewerMap;
     private Object input;
 
     public CdmViewerChooser(Shell parentShell) {
@@ -73,8 +73,8 @@ public class CdmViewerChooser extends PopupDialog implements ISelectionChangedLi
 
         //if only one editor is available then open it
         if(nameViewerMap.size()==1){
-            String commandId = nameViewerMap.keySet().iterator().next();
-            executeCommand(commandId, input);
+            Command command = nameViewerMap.keySet().iterator().next();
+            executeCommand(command.getId(), input);
         }
         else{
             if(nameViewerMap.isEmpty()){