4 package eu
.etaxonomy
.taxeditor
.ui
.selection
;
6 import org
.eclipse
.swt
.events
.SelectionEvent
;
8 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
9 import eu
.etaxonomy
.cdm
.api
.service
.IReferenceService
;
10 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
11 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
12 import eu
.etaxonomy
.taxeditor
.ui
.dialogs
.filteredSelection
.ReferenceSelectionDialog
;
13 import eu
.etaxonomy
.taxeditor
.ui
.forms
.CdmFormFactory
;
14 import eu
.etaxonomy
.taxeditor
.ui
.forms
.ICdmFormElement
;
18 * ReferenceSelectionElement class.
24 public class ReferenceSelectionElement
extends
25 AbstractSelectionElement
<Reference
> {
27 public static final int DEFAULT
= EDITABLE
| SELECTABLE
| DELETABLE
;
31 * Constructor for ReferenceSelectionElement.
35 * a {@link java.lang.String} object.
37 * a {@link eu.etaxonomy.cdm.model.reference.ReferenceBase}
42 * a {@link eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory}
45 * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
47 * @param parentElement
48 * a {@link eu.etaxonomy.taxeditor.ui.forms.ICdmFormElement}
51 public ReferenceSelectionElement(CdmFormFactory toolkit
,
52 ConversationHolder conversation
, ICdmFormElement parentElement
,
53 String labelString
, Reference selection
, int mode
, int style
) {
54 super(toolkit
, conversation
, parentElement
, labelString
, selection
,
62 * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
63 * .events.SelectionEvent)
67 public void widgetSelected(SelectionEvent e
) {
68 Reference newSelection
= ReferenceSelectionDialog
.select(getShell(),
69 getConversationHolder(), entity
);
71 setSelectionInternal(newSelection
);
73 // Reference freshlyLoadedSelection = null;
74 // if (newSelection != null)
75 // freshlyLoadedSelection = CdmStore.getService(
76 // IReferenceService.class).load(newSelection.getUuid());
78 // setSelectionInternal(freshlyLoadedSelection);