Project

General

Profile

Revision 15cd5e08

ID15cd5e08a63c3bfcdb0abc545b85bc98d19ca2d0
Parent a1764026
Child 200e8530

Added by Patrick Plitzner almost 3 years ago

ref #6595 Migrate handler for opening taxon nodes in name editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
148 148
	}
149 149

  
150 150
	public static void openTaxonNodeE4(UUID taxonNodeUuid) throws Exception {
151
	    //FIXME E4 this can be removed when fully migrated
151 152
        TaxonEditorInputE4 input = TaxonEditorInputE4.NewInstance(taxonNodeUuid);
152
        EPartService partService = TaxeditorEditorPlugin.getDefault().getWorkbench().getService(EPartService.class);
153
        EPartService partService = TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getService(EPartService.class);
153 154
        MPart part = partService.createPart("eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4");
154 155
        partService.showPart(part, PartState.ACTIVATE);
155 156
        TaxonNameEditorE4 editor = (TaxonNameEditorE4) part.getObject();
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonNodeHandler.java
2 2
import java.util.UUID;
3 3

  
4 4
import org.eclipse.core.commands.ExecutionEvent;
5
import org.eclipse.ui.PartInitException;
6 5

  
7 6
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
8 7
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
9 8
import eu.etaxonomy.taxeditor.editor.EditorUtil;
10
import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
11 9
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
12 10
import eu.etaxonomy.taxeditor.handler.defaultHandler.DefaultOpenHandlerBase;
13 11
import eu.etaxonomy.taxeditor.model.MessagingUtils;
......
23 21

  
24 22
    @Override
25 23
    protected void open(ExecutionEvent event, TaxonNode entity) {
26
        TaxonEditorInput input = TaxonEditorInput.NewInstanceFromTaxonBase(entity.getTaxon().getUuid());
27 24
        try {
28
            EditorUtil.open(input);
29
        } catch (PartInitException e) {
30
            MessagingUtils.error(DefaultOpenTaxonEditorForTaxonNodeHandler.class, Messages.DefaultOpenTaxonEditorForTaxonNodeHandler_COULD_NOT_OPEN+input.getTaxon(), e);
25
            EditorUtil.openTaxonNodeE4(entity.getUuid());
26
        } catch (Exception e) {
27
            MessagingUtils.error(DefaultOpenTaxonEditorForTaxonNodeHandler.class, Messages.DefaultOpenTaxonEditorForTaxonNodeHandler_COULD_NOT_OPEN+entity.getTaxon(), e);
31 28
        }
32 29
    }
33 30

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)