Revision 104c6a78
Added by Katja Luther almost 10 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java | ||
---|---|---|
21 | 21 |
import org.eclipse.core.runtime.IAdaptable; |
22 | 22 |
import org.eclipse.core.runtime.IProgressMonitor; |
23 | 23 |
import org.eclipse.jface.viewers.DoubleClickEvent; |
24 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
|
25 |
import org.eclipse.jface.viewers.IStructuredSelection; |
|
26 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
|
24 | 27 |
import org.eclipse.jface.viewers.TreePath; |
25 | 28 |
import org.eclipse.ui.IMemento; |
26 | 29 |
import org.eclipse.ui.IViewSite; |
... | ... | |
31 | 34 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
32 | 35 |
import eu.etaxonomy.cdm.api.service.IClassificationService; |
33 | 36 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
37 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
|
34 | 38 |
import eu.etaxonomy.cdm.model.taxon.TaxonComparatorSearch; |
35 | 39 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
36 | 40 |
import eu.etaxonomy.taxeditor.model.DataChangeBridge; |
... | ... | |
79 | 83 |
TaxonComparatorSearch comparator = new TaxonComparatorSearch(); |
80 | 84 |
TaxonNodeComparator viewerComparator = new TaxonNodeComparator(comparator); |
81 | 85 |
this.getCommonViewer().setComparator(viewerComparator); |
86 |
this.getCommonViewer().addSelectionChangedListener(new ISelectionChangedListener() { |
|
87 |
|
|
88 |
@Override |
|
89 |
public void selectionChanged(SelectionChangedEvent arg0) { |
|
90 |
IStructuredSelection selection = (IStructuredSelection) getCommonViewer().getSelection(); |
|
91 |
|
|
92 |
Object firstElement = selection.getFirstElement(); |
|
93 |
// |
|
94 |
if (!(firstElement instanceof Classification)){ |
|
95 |
//NavigationUtil.selectInNavigator(firstElement, null); |
|
96 |
NavigationUtil.openEditor(firstElement); |
|
97 |
} |
|
98 |
|
|
99 |
} |
|
100 |
} ); |
|
82 | 101 |
|
83 | 102 |
if (CdmStore.isActive()) { |
84 | 103 |
|
Also available in: Unified diff
open Taxonpage with single click in taxonnavigator