2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
;
12 import java
.util
.UUID
;
14 import org
.eclipse
.swt
.widgets
.Shell
;
16 import eu
.etaxonomy
.cdm
.api
.service
.IOccurrenceService
;
17 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
18 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
19 import eu
.etaxonomy
.taxeditor
.newWizard
.AbstractNewEntityWizard
;
20 import eu
.etaxonomy
.taxeditor
.newWizard
.NewDerivedUnitBaseWizard
;
21 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
26 public class SpecimenOrObservationBaseSelectionDialog
extends
27 AbstractFilteredCdmResourceSelectionDialog
<SpecimenOrObservationBase
> {
29 public static SpecimenOrObservationBase
select(Shell shell
, //ConversationHolder conversation,
30 SpecimenOrObservationBase observation
){
31 SpecimenOrObservationBaseSelectionDialog dialog
= new SpecimenOrObservationBaseSelectionDialog(shell
, //conversation,
32 "Choose field unit or derived unit", false, SpecimenOrObservationBaseSelectionDialog
.class.getCanonicalName(), observation
);
33 return getSelectionFromDialog(dialog
);
36 protected SpecimenOrObservationBaseSelectionDialog(Shell shell
, //ConversationHolder conversation,
37 String title
, boolean multi
, String settings
,
38 SpecimenOrObservationBase cdmObject
) {
39 super(shell
, //conversation,
40 title
, multi
, settings
, cdmObject
);
45 protected SpecimenOrObservationBase
getPersistentObject(UUID uuid
) {
46 Object object
= CdmStore
.getService(IOccurrenceService
.class).load(uuid
);
47 return HibernateProxyHelper
.deproxy(object
, SpecimenOrObservationBase
.class);
52 protected void callService(String pattern
) {
53 model
=CdmStore
.getService(IOccurrenceService
.class).getUuidAndTitleCache(limitOfInitialElements
,pattern
);
58 protected AbstractNewEntityWizard
getNewEntityWizard(String parameter
) {
59 return new NewDerivedUnitBaseWizard();
64 protected String
[] getNewWizardText() {
65 return new String
[]{"New Field Unit/Derived Unit"};