Revision 5c823b08
Added by Patrick Plitzner about 8 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigator.java | ||
---|---|---|
25 | 25 |
import org.eclipse.core.runtime.IAdaptable; |
26 | 26 |
import org.eclipse.core.runtime.IProgressMonitor; |
27 | 27 |
import org.eclipse.jface.viewers.DoubleClickEvent; |
28 |
import org.eclipse.jface.viewers.ISelection; |
|
28 | 29 |
import org.eclipse.jface.viewers.IStructuredSelection; |
29 | 30 |
import org.eclipse.jface.viewers.TreePath; |
30 | 31 |
import org.eclipse.ui.IMemento; |
... | ... | |
40 | 41 |
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled; |
41 | 42 |
import eu.etaxonomy.cdm.api.service.IClassificationService; |
42 | 43 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
44 |
import eu.etaxonomy.cdm.model.common.ICdmBase; |
|
43 | 45 |
import eu.etaxonomy.cdm.model.taxon.Classification; |
44 | 46 |
import eu.etaxonomy.cdm.model.taxon.TaxonNaturalComparator; |
45 | 47 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode; |
... | ... | |
452 | 454 |
/** {@inheritDoc} */ |
453 | 455 |
@Override |
454 | 456 |
protected void handleDoubleClick(DoubleClickEvent event) { |
455 |
if(event.getSelection() instanceof IStructuredSelection){ |
|
456 |
Object selectedObject = ((IStructuredSelection) event.getSelection()).getFirstElement(); |
|
457 |
CdmViewerChooser chooser = new CdmViewerChooser(getSite().getShell()); |
|
458 |
chooser.chooseViewer(selectedObject); |
|
459 |
} |
|
457 |
ISelection selection = event.getSelection(); |
|
458 |
if(selection instanceof IStructuredSelection){ |
|
459 |
Object firstElement = ((IStructuredSelection) selection).getFirstElement(); |
|
460 |
if(firstElement instanceof ICdmBase){ |
|
461 |
NavigationUtil.openEditor((ICdmBase) firstElement); |
|
462 |
} |
|
463 |
} |
|
460 | 464 |
// If the double click is passed up to the super-class it will |
461 | 465 |
// expand/collapse trees. |
462 | 466 |
// We do not want that |
Also available in: Unified diff
Remove CdmViewerChooser from double-click functionality of taxon
navigator