Revision 43d2a621
Added by Andreas Kohlbecker about 12 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.Level; |
|
14 |
import org.apache.log4j.Logger; |
|
13 | 15 |
import org.eclipse.core.commands.AbstractHandler; |
14 | 16 |
import org.eclipse.core.commands.ExecutionEvent; |
15 | 17 |
import org.eclipse.core.commands.ExecutionException; |
16 | 18 |
import org.eclipse.core.commands.common.NotDefinedException; |
19 |
import org.eclipse.core.expressions.IEvaluationContext; |
|
17 | 20 |
import org.eclipse.core.runtime.Status; |
18 | 21 |
import org.eclipse.swt.widgets.Event; |
19 | 22 |
import org.eclipse.ui.IWorkbenchPart; |
... | ... | |
37 | 40 |
* @version 1.0 |
38 | 41 |
*/ |
39 | 42 |
public class CreateConceptRelationHandler extends AbstractHandler { |
40 |
|
|
43 |
|
|
41 | 44 |
/* (non-Javadoc) |
42 | 45 |
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent) |
43 | 46 |
*/ |
... | ... | |
48 | 51 |
|
49 | 52 |
Taxon taxonToBeFiltered = editor.getTaxon(); |
50 | 53 |
|
54 |
/* we need to get the activePart before calling TaxonBaseSelectionDialog.selectTaxon(), otherwise the |
|
55 |
* the variable of the parent applicationContext in event are overwritten during this method call |
|
56 |
* this is Linux specific bugfix see: #2685 ([LINUX] Editing concept relationships does not work under linux) |
|
57 |
*/ |
|
58 |
IWorkbenchPart activePart = HandlerUtil.getActivePart(event); |
|
59 |
|
|
51 | 60 |
Taxon relatedConcept = TaxonBaseSelectionDialog.selectTaxon(HandlerUtil.getActiveShell(event), editor.getConversationHolder(), taxonToBeFiltered); |
52 |
|
|
61 |
|
|
62 |
|
|
53 | 63 |
if(relatedConcept == null){ |
54 | 64 |
return Status.CANCEL_STATUS; |
55 | 65 |
} |
56 | 66 |
|
57 | 67 |
TaxonRelationshipTypeInverseContainer typeInverseContainer = (TaxonRelationshipTypeInverseContainer) ((Event)event.getTrigger()).data; |
58 | 68 |
|
59 |
IWorkbenchPart activePart = HandlerUtil.getActivePart(event); |
|
69 |
|
|
60 | 70 |
IPostOperationEnabled postOperationEnabled = (activePart instanceof IPostOperationEnabled) ? (IPostOperationEnabled) activePart : null; |
61 | 71 |
|
62 | 72 |
try { |
Also available in: Unified diff
fixing #2685 ([LINUX] Editing concept relationships does not work under linux)