Revision 50846164
Added by Niels Hoffmann over 11 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/handler/CreateConceptRelationHandler.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.editor.view.concept.handler; |
12 | 12 |
|
13 |
import org.apache.log4j.Logger; |
|
14 | 13 |
import org.eclipse.core.commands.AbstractHandler; |
15 | 14 |
import org.eclipse.core.commands.ExecutionEvent; |
16 | 15 |
import org.eclipse.core.commands.ExecutionException; |
17 | 16 |
import org.eclipse.core.commands.common.NotDefinedException; |
17 |
import org.eclipse.core.runtime.Status; |
|
18 | 18 |
import org.eclipse.swt.widgets.Event; |
19 | 19 |
import org.eclipse.ui.IWorkbenchPart; |
20 | 20 |
import org.eclipse.ui.handlers.HandlerUtil; |
21 | 21 |
|
22 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
23 | 22 |
import eu.etaxonomy.cdm.model.taxon.Taxon; |
24 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship; |
|
25 |
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; |
|
26 | 23 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
27 | 24 |
import eu.etaxonomy.taxeditor.editor.Page; |
28 | 25 |
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor; |
... | ... | |
30 | 27 |
import eu.etaxonomy.taxeditor.model.TaxonRelationshipTypeInverseContainer; |
31 | 28 |
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation; |
32 | 29 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
33 |
import eu.etaxonomy.taxeditor.parser.ParseHandler; |
|
34 | 30 |
import eu.etaxonomy.taxeditor.ui.dialogs.filteredSelection.TaxonBaseSelectionDialog; |
35 | 31 |
|
36 | 32 |
/** |
... | ... | |
41 | 37 |
* @version 1.0 |
42 | 38 |
*/ |
43 | 39 |
public class CreateConceptRelationHandler extends AbstractHandler { |
44 |
private static final Logger logger = Logger |
|
45 |
.getLogger(CreateConceptRelationHandler.class); |
|
46 | 40 |
|
47 | 41 |
/* (non-Javadoc) |
48 | 42 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
... | ... | |
54 | 48 |
|
55 | 49 |
Taxon relatedConcept = TaxonBaseSelectionDialog.selectTaxon(HandlerUtil.getActiveShell(event), editor.getConversationHolder()); |
56 | 50 |
|
51 |
if(relatedConcept == null){ |
|
52 |
return Status.CANCEL_STATUS; |
|
53 |
} |
|
54 |
|
|
57 | 55 |
TaxonRelationshipTypeInverseContainer typeInverseContainer = (TaxonRelationshipTypeInverseContainer) ((Event)event.getTrigger()).data; |
58 | 56 |
|
59 | 57 |
IWorkbenchPart activePart = HandlerUtil.getActivePart(event); |
Also available in: Unified diff
Fixes #2680