import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.dialog.selection.SelectionDialogFactory;
+import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
/**
* View which shows a list of "data" that can be imported into the CDM
* @param <T> the CDM type that will be handled by this view
*/
public abstract class DataImportViewE4<T> implements IPartContentHasFactualData,
-IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, Listener{
+IConversationEnabled, IPartContentHasDetails, IPartContentHasSupplementalData, IContextListener, Listener, IEditorAreaPart{
protected final Logger logger = Logger.getLogger(DataImportViewE4.class);
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
import org.eclipse.jface.wizard.Wizard;
import eu.etaxonomy.taxeditor.store.AppModelId;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.view.dataimport.QueryType;
+import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
+import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
/**
* Wizard for querying specimen provider.
@Inject
private EPartService partService;
+ @Inject
+ private MApplication application;
+
+ @Inject
+ private EModelService modelService;
+
private IEclipseContext context;
/**
try {
serviceWrapper = providerSelectionPage.getQueryServiceWrapper();
InputStream stream = null;
-
+ MPart part = null;
if (providerSelectionPage.getQueryType().equals(QueryType.BIOCASE)){
stream =((BioCaseQueryServiceWrapper) serviceWrapper).query(query, configurator.getSourceUri());
SpecimenImportReport report = new SpecimenImportReport();
UnitAssociationWrapper unitNodesList = AbcdParseUtility.parseUnitsNodeList(stream, report);
- MPart part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4);
+ part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_SPECIMENIMPORTVIEWE4);
part = partService.showPart(part, PartState.ACTIVATE);
SpecimenImportViewE4 specimenImportView = (SpecimenImportViewE4) part.getObject();
specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
dataImportView = specimenImportView;
} else{
- MPart part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4);
+ part = partService.createPart(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_VIEW_DATAIMPORT_E4_GBIFRESPONSEIMPORTVIEWE4);
part = partService.showPart(part, PartState.ACTIVATE);
GbifResponseImportViewE4 gbifImportView = (GbifResponseImportViewE4) part.getObject();
gbifImportView.setQuery(query);
dataImportView = gbifImportView;
}
+ if(part.getObject() instanceof IEditorAreaPart){
+ MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
+ if(editorAreaPartStack!=null){
+ editorAreaPartStack.getChildren().add(part);
+ }
+ part = partService.showPart(part, PartState.VISIBLE);
+ }
} catch (IOException e) {
e.printStackTrace();
}
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.e4.ui.workbench.modeling.EPartService.PartState;
-import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
+import eu.etaxonomy.taxeditor.workbench.part.IEditorAreaPart;
public class OpenPartHandler {
String partId = parameterMap.get(AppModelId.COMMANDPARAMETER_EU_ETAXONOMY_TAXEDITOR_WORKBENCH_COMMANDPARAMETER_PARTNAME).toString();
MPart part = partService.createPart(partId);
part = partService.showPart(part, PartState.ACTIVATE);
- if(part.getObject() instanceof IE4SavablePart){
+ if(part.getObject() instanceof IEditorAreaPart){
MPartStack editorAreaPartStack = WorkbenchUtility.getEditorAreaPartStack(application, modelService);
if(editorAreaPartStack!=null){
editorAreaPartStack.getChildren().add(part);