eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailsWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventWizardPage.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/IDerivedUnitFacadeDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/NamedAreaDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SourceCollectionDetailSection.java -text
package eu.etaxonomy.taxeditor.editor.view.derivate;
-import java.util.UUID;
-
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.actions.CompoundContributionItem;
import org.eclipse.ui.handlers.IHandlerService;
-import eu.etaxonomy.cdm.api.application.ICdmApplicationConfiguration;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy;
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
import eu.etaxonomy.cdm.model.occurrence.DerivationEvent;
import eu.etaxonomy.cdm.model.occurrence.DerivationEventType;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
-import eu.etaxonomy.taxeditor.store.CdmStore;
+/**
+ * Context menu for the creation of sub-derivates.
+ *
+ */
public class CreateDerivateContextMenu extends CompoundContributionItem {
private final IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class);
if(selectedElement instanceof FieldUnit){
MenuItem createSpecimen = new MenuItem(menu, SWT.None);
createSpecimen.setText("Specimen");
- createSpecimen.addSelectionListener(new SelectionListener() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- ICdmApplicationConfiguration currentApplicationConfiguration = CdmStore.getCurrentApplicationConfiguration();
-// TransactionStatus transaction = currentApplicationConfiguration.startTransaction();
- IOccurrenceService occurrenceService = currentApplicationConfiguration.getOccurrenceService();
- FieldUnit fieldUnit = (FieldUnit)selectedElement;
- UUID uuid = fieldUnit.getUuid();
- fieldUnit = (FieldUnit) occurrenceService.load(uuid);
-// fieldUnit = (FieldUnit)HibernateProxyHelper.deproxy(fieldUnit);
-
- DerivedUnit specimen = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
- fieldUnit.addDerivationEvent(DerivationEvent.NewSimpleInstance(fieldUnit, specimen, DerivationEventType.GATHERING_IN_SITU()));
- specimen.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
- specimen.getTitleCache(); //update title cache
- IWorkbenchPart activePart = AbstractUtility.getActivePart();
-// occurrenceService.saveOrUpdate(fieldUnit);
-// occurrenceService.saveOrUpdate(specimen);
-// currentApplicationConfiguration.commitTransaction(transaction);
- if(activePart instanceof DerivateView){
- DerivateView derivateView = (DerivateView)activePart;
- derivateView.viewer.refresh();
- }
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
- }
- });
+ FieldUnit fieldUnit = (FieldUnit) selectedElement;
+ createSpecimen.addSelectionListener(new WidgetSelectionListener(fieldUnit, DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen)));
+
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// ICdmApplicationConfiguration currentApplicationConfiguration = CdmStore.getCurrentApplicationConfiguration();
+//// TransactionStatus transaction = currentApplicationConfiguration.startTransaction();
+// IOccurrenceService occurrenceService = currentApplicationConfiguration.getOccurrenceService();
+// FieldUnit fieldUnit = (FieldUnit)selectedElement;
+// UUID uuid = fieldUnit.getUuid();
+// fieldUnit = (FieldUnit) occurrenceService.load(uuid);
+//// fieldUnit = (FieldUnit)HibernateProxyHelper.deproxy(fieldUnit);
+//
+// DerivedUnit specimen = DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
+// fieldUnit.addDerivationEvent(DerivationEvent.NewSimpleInstance(fieldUnit, specimen, DerivationEventType.GATHERING_IN_SITU()));
+// specimen.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
+// specimen.getTitleCache(); //update title cache
+// IWorkbenchPart activePart = AbstractUtility.getActivePart();
+//// occurrenceService.saveOrUpdate(fieldUnit);
+//// occurrenceService.saveOrUpdate(specimen);
+//// currentApplicationConfiguration.commitTransaction(transaction);
+// if(activePart instanceof DerivateView){
+// DerivateView derivateView = (DerivateView)activePart;
+// derivateView.viewer.refresh();
+// }
+// }
+//
+// @Override
+// public void widgetDefaultSelected(SelectionEvent e) {
+// // TODO Auto-generated method stub
+//
+// }
+// });
MenuItem createLivingPlantPhoto = new MenuItem(menu, SWT.None);
createLivingPlantPhoto.setText("Living Plant Photo");
+ createLivingPlantPhoto.addSelectionListener(new WidgetSelectionListener(fieldUnit, DerivedUnit.NewInstance(SpecimenOrObservationType.StillImage)));
}
//context menu for Specimen
else if(selectedElement instanceof DerivedUnit && ((DerivedUnit)selectedElement).getRecordBasis()==SpecimenOrObservationType.PreservedSpecimen){
+ DerivedUnit derivedUnit = (DerivedUnit) selectedElement;
MenuItem createTissueSample = new MenuItem(menu, SWT.None);
createTissueSample.setText("Tissue Sample");
+ createTissueSample.addSelectionListener(new WidgetSelectionListener(derivedUnit, DerivedUnit.NewInstance(SpecimenOrObservationType.TissueSample)));
+
MenuItem createDNASample = new MenuItem(menu, SWT.None);
createDNASample.setText("DNA Sample");
+ createDNASample.addSelectionListener(new WidgetSelectionListener(derivedUnit, DerivedUnit.NewInstance(SpecimenOrObservationType.DnaSample)));
+
MenuItem createSpecimenScan = new MenuItem(menu, SWT.None);
createSpecimenScan.setText("Specimen Scan");
+ createSpecimenScan.addSelectionListener(new WidgetSelectionListener(derivedUnit, DerivedUnit.NewInstance(SpecimenOrObservationType.StillImage)));
+
MenuItem createArtwork = new MenuItem(menu, SWT.None);
createArtwork.setText("Artwork");
+ createArtwork.addSelectionListener(new WidgetSelectionListener(derivedUnit, DerivedUnit.NewInstance(SpecimenOrObservationType.StillImage)));
+
MenuItem createLivingPlantPhoto = new MenuItem(menu, SWT.None);
createLivingPlantPhoto.setText("Living Plant Photo");
+ createLivingPlantPhoto.addSelectionListener(new WidgetSelectionListener(derivedUnit, DerivedUnit.NewInstance(SpecimenOrObservationType.StillImage)));
}
else{
MenuItem menuItem = new MenuItem(menu, SWT.None);
return contributionItems;
}
+ private class WidgetSelectionListener implements SelectionListener{
+
+ private final SpecimenOrObservationBase parent;
+ private final DerivedUnit derivate;
+
+ /**
+ * @param parent
+ */
+ public WidgetSelectionListener(SpecimenOrObservationBase parent, DerivedUnit derivate) {
+ this.parent = parent;
+ this.derivate = derivate;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+// ICdmApplicationConfiguration currentApplicationConfiguration = CdmStore.getCurrentApplicationConfiguration();
+// IOccurrenceService occurrenceService = currentApplicationConfiguration.getOccurrenceService();
+// UUID uuid = parent.getUuid();
+// fieldUnit = (FieldUnit) occurrenceService.load(uuid);
+
+ parent.addDerivationEvent(DerivationEvent.NewSimpleInstance(parent, derivate, DerivationEventType.GATHERING_IN_SITU()));
+ derivate.setCacheStrategy(new DerivedUnitFacadeCacheStrategy());
+ derivate.getTitleCache(); //update title cache
+ IWorkbenchPart activePart = AbstractUtility.getActivePart();
+ if(activePart instanceof DerivateView){
+ DerivateView derivateView = (DerivateView)activePart;
+ derivateView.viewer.refresh();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+
}
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.swt.graphics.Image;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
+
+/**
+ * Label provider for the {@link DerivateView}
+ *
+ */
public class DerivateLabelProvider extends ColumnLabelProvider implements IStyledLabelProvider {
@Override
*/
@Override
public String getText(Object element) {
+ if(element instanceof SpecimenOrObservationBase){
+ SpecimenOrObservationBase derivate = (SpecimenOrObservationBase) element;
+ SpecimenOrObservationType type = derivate.getRecordBasis();
+ return derivate.getTitleCache() + (type!=null?"["+type.toString()+"]":"");
+ }
return super.getText(element);
}
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
import eu.etaxonomy.cdm.model.occurrence.MediaSpecimen;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitGeneralWizardPage;
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitWizardPage;
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralWizardPage;
/**
* <p>NewDerivedUnitBaseWizard class.</p>
* @created Jun 16, 2010
* @version 1.0
*/
-public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<DerivedUnit> {
+public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard<SpecimenOrObservationBase> {
private SpecimenOrObservationType specOrObsType = null;
public NewDerivedUnitBaseWizard() {
/** {@inheritDoc} */
@Override
public void addPages() {
- DerivedUnitFacade facade = getFacade();
+ DerivedUnitFacade facade = null;
try {
- if(getEntity() != null) {
- facade = DerivedUnitFacade.NewInstance(getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
+ if(getEntity() instanceof DerivedUnit) {
+ facade = DerivedUnitFacade.NewInstance((DerivedUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
facade.getFieldUnit(true); //TODO: this is a temporary solution for the Campanula project as
//this ALWAYS needs a FieldUnit as root of the hierarchy
+
+ addPage(new DerivedUnitGeneralWizardPage(formFactory, getConversationHolder(), facade));
+ addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
+ addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
+ addPage(new DerivedUnitBaseWizardPage(formFactory, getConversationHolder(), facade));
+ }
+ else if(getEntity() instanceof FieldUnit){
+ facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit)getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
+ addPage(new FieldUnitGeneralWizardPage(formFactory, getConversationHolder(), facade));
+ addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
+ addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
}
} catch (DerivedUnitFacadeNotSupportedException e) {
- // w should never get here
+ // we should never get here
throw new IllegalStateException();
}
- addPage(new GeneralWizardPage(formFactory, getConversationHolder(), facade));
- addPage(new GatheringEventWizardPage(formFactory, getConversationHolder(), facade));
- addPage(new FieldUnitWizardPage(formFactory, getConversationHolder(), facade));
- addPage(new DerivedUnitBaseWizardPage(formFactory, getConversationHolder(), facade));
-
- }
-
- /**
- * @return
- */
- private DerivedUnitFacade getFacade() {
- try {
- if(getEntity() != null) {
- return DerivedUnitFacade.NewInstance(getEntity(), PreferencesUtil.getDerivedUnitConfigurator());
- }
- } catch (DerivedUnitFacadeNotSupportedException e) {
- // w should never get here
- throw new IllegalStateException();
- }
- return null;
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity()
- */
- /** {@inheritDoc} */
- @Override
- protected DerivedUnit createNewEntity() {
- if(specOrObsType == null) {
- return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
- } else {
- if(SpecimenOrObservationType.Media.equals(specOrObsType) ||
- ((specOrObsType.getKindOf() != null) &&
- specOrObsType.getKindOf().equals(SpecimenOrObservationType.Media))) {
- return MediaSpecimen.NewInstance(SpecimenOrObservationType.Media);
- } else {
- return DerivedUnit.NewInstance(specOrObsType);
- }
- }
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#
+ * createNewEntity()
+ */
+ /** {@inheritDoc} */
+ @Override
+ protected SpecimenOrObservationBase createNewEntity() {
+ if (specOrObsType == null) {
+ return DerivedUnit.NewInstance(SpecimenOrObservationType.PreservedSpecimen);
+ } else {
+ if (SpecimenOrObservationType.Media.equals(specOrObsType)
+ || ((specOrObsType.getKindOf() != null) && specOrObsType.getKindOf().equals(SpecimenOrObservationType.Media))) {
+ return MediaSpecimen.NewInstance(SpecimenOrObservationType.Media);
+ } else if (specOrObsType.equals(SpecimenOrObservationType.FieldUnit)) {
+ return FieldUnit.NewInstance();
+ } else {
+ return DerivedUnit.NewInstance(specOrObsType);
+ }
+ }
+ }
/* (non-Javadoc)
* @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity()
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
- * @author pplitzner
- * @date 25.11.2013
+ * The widgets of the {@link DerivateSearchView}<br>
*
*/
public class DerivateSearchComposite extends Composite {
private final FormToolkit formToolkit = new FormToolkit(Display.getDefault());
- private Text searchField;
- private Table table;
- private TableViewer resultViewer;
- private Combo comboDerivateType;
+ private final Text searchField;
+ private final Table table;
+ private final TableViewer resultViewer;
+ private final Combo comboDerivateType;
/**
* Create the composite.
Label lblDerivateType = new Label(this, SWT.NULL);
lblDerivateType.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
- lblDerivateType.setText("Derivate Type");
+ lblDerivateType.setText("Derivate Filter");
comboDerivateType = new Combo(this, SWT.NONE);
comboDerivateType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
formToolkit.paintBordersFor(comboDerivateType);
+ Label lblNameFilter = new Label(this, SWT.NULL);
+ lblNameFilter.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ lblNameFilter.setText("Name Filter");
+
searchField = formToolkit.createText(this, "New Text", SWT.NONE);
searchField.setText("");
- searchField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ searchField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
resultViewer = new TableViewer(this, SWT.BORDER | SWT.FULL_SELECTION);
table = resultViewer.getTable();
import eu.etaxonomy.taxeditor.store.CdmStore;
/**
- * @author pplitzner
- * @date 25.11.2013
+ * Controller class for the {@link DerivateSearchComposite}.<br>
+ * This controller contains the logic to search the data base for {@link SpecimenOrObservationBase}s
+ * and handles GUI events.
*
*/
public class DerivateSearchCompositeController {
import org.eclipse.swt.graphics.Color;
import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
/**
- * @author pplitzner
- * @date 25.11.2013
- *
+ * Label provider for the {@link DerivateSearchView}.
*/
public class DerivateSearchResultsLabelProvider extends ColumnLabelProvider {
/** {@inheritDoc} */
@Override
public String getText(Object element) {
+ if(element instanceof SpecimenOrObservationBase){
+ SpecimenOrObservationBase derivate = (SpecimenOrObservationBase) element;
+ SpecimenOrObservationType type = derivate.getRecordBasis();
+ return derivate.getTitleCache() + (type!=null?"["+type.toString()+"]":"");
+ }
if(element instanceof UuidAndTitleCache){
return ((UuidAndTitleCache) element).getTitleCache();
}
/** {@inheritDoc} */
@Override
public String getToolTipText(Object element) {
- return "Name: " + element.toString();
+ return element.toString();
}
}
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+
/**
- * @author pplitzner
- * @date 25.11.2013
- *
+ * This view allows to search for and filter {@link SpecimenOrObservationBase}s and display
+ * the results in a list. The results can be selected and opened in an editor.
*/
public class DerivateSearchView extends ViewPart {
public DerivateSearchView() {
* @created Dec 17, 2010
* @version 1.0
*/
-public class GeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+public class DerivedUnitGeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
/**
* @param formFactory
* @param conversation
* @param entity
*/
- public GeneralWizardPage(CdmFormFactory formFactory,
+ public DerivedUnitGeneralWizardPage(CdmFormFactory formFactory,
ConversationHolder conversation, DerivedUnitFacade entity) {
super(formFactory, conversation, entity);
setTitle("General Specimen Data");
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.ui.section.occurrence;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+/**
+ *
+ */
+public class FieldUnitGeneralWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param entity
+ */
+ public FieldUnitGeneralWizardPage(CdmFormFactory formFactory,
+ ConversationHolder conversation, DerivedUnitFacade entity) {
+ super(formFactory, conversation, entity);
+ setTitle("General FieldUnit Data");
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
+ */
+ @Override
+ protected void checkComplete() {
+ setPageComplete(true);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+ */
+ @Override
+ public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
+ FieldUnitGeneralDetailElement detailElement = formFactory.createFieldUnitGeneralDetailElement(rootElement);
+ detailElement.setEntity(getEntity());
+ checkComplete();
+ return detailElement;
+ }
+
+}
import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitBaseWizardPage;
import eu.etaxonomy.taxeditor.ui.section.occurrence.FieldUnitWizardPage;
import eu.etaxonomy.taxeditor.ui.section.occurrence.GatheringEventWizardPage;
-import eu.etaxonomy.taxeditor.ui.section.occurrence.GeneralWizardPage;
+import eu.etaxonomy.taxeditor.ui.section.occurrence.DerivedUnitGeneralWizardPage;
import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceWizardPage;
import eu.etaxonomy.taxeditor.ui.section.user.UserDetailWizardPage;
throw new IllegalStateException();
}
- addPage(new GeneralWizardPage(formFactory,
+ addPage(new DerivedUnitGeneralWizardPage(formFactory,
selectionElement.getConversationHolder(), facade));
addPage(new GatheringEventWizardPage(formFactory,
selectionElement.getConversationHolder(), facade));