Revision 0bd0e199
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/handler/ChangeSynonymToAcceptedTaxonHandlerE4.java | ||
---|---|---|
25 | 25 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
26 | 26 |
import org.eclipse.jface.viewers.IStructuredSelection; |
27 | 27 |
import org.eclipse.swt.widgets.Shell; |
28 |
import org.eclipse.ui.PartInitException; |
|
29 | 28 |
|
30 | 29 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
31 | 30 |
import eu.etaxonomy.cdm.model.name.HomotypicalGroup; |
... | ... | |
40 | 39 |
import eu.etaxonomy.taxeditor.editor.name.handler.NameEditorMenuPropertyTester; |
41 | 40 |
import eu.etaxonomy.taxeditor.editor.name.operation.ChangeSynonymToAcceptedTaxonOperation; |
42 | 41 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
43 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
|
44 | 42 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
45 | 43 |
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonNodeSelectionDialog; |
46 | 44 |
|
... | ... | |
121 | 119 |
// Open new unsaved editor with existing taxon's parent as temporary parent |
122 | 120 |
TaxonNode newNode = (TaxonNode) objectAffectedByOperation; |
123 | 121 |
|
124 |
try { |
|
125 |
EditorUtil.openTaxonNodeE4(newNode.getUuid(), modelService, partService, application); |
|
126 |
} catch (PartInitException e) { |
|
127 |
e.printStackTrace(); |
|
128 |
} catch (Exception e) { |
|
129 |
MessagingUtils.warningDialog(Messages.ChangeSynonymToAcceptedTaxonHandler_CREATE_FAILURE, this, e.getMessage()); |
|
130 |
} |
|
122 |
EditorUtil.openTaxonNodeE4(newNode.getUuid(), modelService, partService, application); |
|
131 | 123 |
} |
132 | 124 |
return true; |
133 | 125 |
} |
... | ... | |
147 | 139 |
NameEditorMenuPropertyTester.isNotHomotypicSynonymOfAcceptedTaxon(selectedElement) |
148 | 140 |
&& !NameEditorMenuPropertyTester.isAccepted(selectedElement) |
149 | 141 |
&& !NameEditorMenuPropertyTester.isMisapplication(selectedElement); |
150 |
// menuItem.setVisible(canExecute);
|
|
142 |
menuItem.setVisible(canExecute); |
|
151 | 143 |
return canExecute; |
152 | 144 |
} |
153 | 145 |
|
Also available in: Unified diff
ref #6595 Remove exception from editor opening