Project

General

Profile

Revision 0b7e0883

ID0b7e08834f03d3e7ce2ea6c1f55c908a14d76758
Parent 56036a0c
Child c2138217

Added by Patrick Plitzner over 1 year ago

fix #8703 Open term search and specimen (import) search to editor area

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/DataImportViewE4.java
52 52
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
53 53
import eu.etaxonomy.taxeditor.store.CdmStore;
54 54
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
55
import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
55 56

  
56 57
/**
57 58
 * View which shows a list of "data" that can be imported into the CDM
......
61 62
 * @param <T> the CDM type that will be handled by this view
62 63
 */
63 64
public abstract class DataImportViewE4<T> implements IPartContentHasFactualData,
64
IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, Listener{
65
IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, Listener, IEditorAreaPart{
65 66

  
66 67
    protected final Logger logger = Logger.getLogger(DataImportViewE4.class);
67 68

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/e4/SpecimenSearchWizardE4.java
19 19
import org.eclipse.core.runtime.jobs.Job;
20 20
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
21 21
import org.eclipse.e4.core.contexts.IEclipseContext;
22
import org.eclipse.e4.ui.model.application.MApplication;
22 23
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
24
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
25
import org.eclipse.e4.ui.workbench.modeling.EModelService;
23 26
import org.eclipse.e4.ui.workbench.modeling.EPartService;
24 27
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
25 28
import org.eclipse.jface.wizard.Wizard;
......
36 39
import eu.etaxonomy.taxeditor.store.AppModelId;
37 40
import eu.etaxonomy.taxeditor.store.CdmStore;
38 41
import eu.etaxonomy.taxeditor.view.dataimport.QueryType;
42
import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
43
import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
39 44

  
40 45
/**
41 46
 * Wizard for querying specimen provider.
......
52 57
    @Inject
53 58
    private EPartService partService;
54 59

  
60
    @Inject
61
    private MApplication application;
62

  
63
    @Inject
64
    private EModelService modelService;
65

  
55 66
    private IEclipseContext context;
56 67

  
57 68
    /**
......
86 97
        try {
87 98
            serviceWrapper = providerSelectionPage.getQueryServiceWrapper();
88 99
            InputStream stream = null;
89

  
100
            MPart part = null;
90 101
            if (providerSelectionPage.getQueryType().equals(QueryType.BIOCASE)){
91 102
                stream =((BioCaseQueryServiceWrapper) serviceWrapper).query(query, configurator.getSourceUri());
92 103
                SpecimenImportReport report = new SpecimenImportReport();
93 104
                UnitAssociationWrapper unitNodesList = AbcdParseUtility.parseUnitsNodeList(stream, report);
94 105

  
95
                MPart part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4);
106
                part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4);
96 107
                part = partService.showPart(part, PartState.ACTIVATE);
97 108
                SpecimenImportViewE4 specimenImportView = (SpecimenImportViewE4) part.getObject();
98 109
                specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
......
101 112
                dataImportView = specimenImportView;
102 113

  
103 114
            } else{
104
                MPart part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4);
115
                part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4);
105 116
                part = partService.showPart(part, PartState.ACTIVATE);
106 117
                GbifResponseImportViewE4 gbifImportView = (GbifResponseImportViewE4) part.getObject();
107 118
                gbifImportView.setQuery(query);
......
109 120
                dataImportView = gbifImportView;
110 121

  
111 122
            }
123
            if(part.getObject() instanceof IEditorAreaPart){
124
                MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
125
                if(editorAreaPartStack!=null){
126
                    editorAreaPartStack.getChildren().add(part);
127
                }
128
                part = partService.showPart(part, PartState.VISIBLE);
129
            }
112 130
        } catch (IOException e) {
113 131
            e.printStackTrace();
114 132
        }
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/search/facet/term/TermSearch.java
14 14
import org.eclipse.swt.widgets.Composite;
15 15

  
16 16
import eu.etaxonomy.taxeditor.view.search.facet.SearchComposite;
17
import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
17 18

  
18 19
/**
19 20
 * @author pplitzner
20 21
 * @since Jan 22, 2019
21 22
 *
22 23
 */
23
public class TermSearch {
24
public class TermSearch implements IEditorAreaPart{
24 25

  
25 26
    @SuppressWarnings("unused")
26 27
    @PostConstruct
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenPartHandler.java
13 13
import org.eclipse.e4.ui.workbench.modeling.EPartService;
14 14
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
15 15

  
16
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
16
import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
17 17

  
18 18
public class OpenPartHandler {
19 19

  
......
27 27
        String partId = parameterMap.get(AppModelId.COMMANDPARAMETER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMANDPARAMETER_PARTNAME).toString();
28 28
        MPart part = partService.createPart(partId);
29 29
        part = partService.showPart(part, PartState.ACTIVATE);
30
        if(part.getObject() instanceof IE4SavablePart){
30
        if(part.getObject() instanceof IEditorAreaPart){
31 31
            MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
32 32
            if(editorAreaPartStack!=null){
33 33
                editorAreaPartStack.getChildren().add(part);
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IE4SavablePart.java
23 23
 * @since Jun 28, 2017
24 24
 *
25 25
 */
26
public interface IE4SavablePart {
26
public interface IE4SavablePart extends IEditorAreaPart{
27 27
    //FIXME E4
28 28

  
29 29
    /**
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/part/IEditorAreaPart.java
1
// $Id$
2
/**
3
* Copyright (C) 2019 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.workbench.part;
11

  
12
/**
13
 * Implementing parts will be opened in the editor area.
14
 * @author pplitzner
15
 * @date 19.11.2019
16
 *
17
 */
18
public interface IEditorAreaPart {
19

  
20
}

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)