1
|
package eu.etaxonomy.taxeditor.navigation;
|
2
|
|
3
|
import java.util.HashMap;
|
4
|
import java.util.Map;
|
5
|
|
6
|
import org.apache.log4j.Logger;
|
7
|
import org.eclipse.jface.wizard.WizardDialog;
|
8
|
import org.eclipse.ui.PlatformUI;
|
9
|
|
10
|
import eu.etaxonomy.cdm.model.taxon.Classification;
|
11
|
import eu.etaxonomy.taxeditor.newWizard.NewClassificationWizard;
|
12
|
import eu.etaxonomy.taxeditor.view.ICdmViewer;
|
13
|
|
14
|
public class NavigationCdmViewer implements ICdmViewer {
|
15
|
|
16
|
|
17
|
@SuppressWarnings("unused")
|
18
|
private final Logger logger = Logger.getLogger(NavigationCdmViewer.class);
|
19
|
|
20
|
@Override
|
21
|
public void show(Object input, Class<?> viewerClass) {
|
22
|
if(viewerClass.equals(NewClassificationWizard.class)){
|
23
|
if(input instanceof Classification){
|
24
|
Classification classification = (Classification)input;
|
25
|
NewClassificationWizard classificationWizard = new NewClassificationWizard();
|
26
|
classificationWizard.init(null, null);
|
27
|
classificationWizard.setEntity(classification);
|
28
|
WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), classificationWizard);
|
29
|
dialog.open();
|
30
|
}
|
31
|
}
|
32
|
}
|
33
|
|
34
|
@Override
|
35
|
public Map<Class<?>, String> getViewerClasses(Object input) {
|
36
|
Map<Class<?>, String> viewerNameMap = new HashMap<Class<?>, String>();
|
37
|
if(input instanceof Classification){
|
38
|
viewerNameMap.put(NewClassificationWizard.class, "Classification Wizard");
|
39
|
}
|
40
|
return viewerNameMap;
|
41
|
}
|
42
|
|
43
|
}
|