3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.ui
.selection
;
13 import org
.eclipse
.swt
.events
.SelectionEvent
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
17 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
18 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.NamedAreaSelectionDialog
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
24 * NamedAreaSelectionElement class.
28 * @created May 11, 2010
31 public class NamedAreaSelectionElement
extends
32 AbstractSelectionElement
<NamedArea
> {
34 public static final int DEFAULT
= NOTHING
;
38 * Constructor for NamedAreaSelectionElement.
42 * a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory}
45 * a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder}
47 * @param parentElement
48 * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
51 * a {@link java.lang.String} object.
53 * a {@link eu.etaxonomy.cdm.model.location.NamedArea} object.
57 public NamedAreaSelectionElement(CdmFormFactory formFactory
,
58 ConversationHolder conversation
, ICdmFormElement parentElement
,
59 String labelString
, NamedArea entity
, int mode
, int style
) {
60 super(formFactory
, conversation
, parentElement
, labelString
, entity
,
66 public void widgetSelected(SelectionEvent e
) {
67 NamedArea newSelection
= NamedAreaSelectionDialog
.select(
68 getLayoutComposite().getShell(), getConversationHolder(),
70 setSelectionInternal(newSelection
);
75 protected String
getTitle() {
76 return (entity
!= null) ? NamedArea
.labelWithLevel(entity
,
77 CdmStore
.getDefaultLanguage()) : "";