Changed calls to retrieve term vocabularies to preferred term mechanism where applicable.
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / editor / description / CommonNameComposite.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
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.
9 */
10
11 package eu.etaxonomy.taxeditor.editor.description;
12
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.ui.views.properties.IPropertySource;
15
16 import eu.etaxonomy.cdm.model.common.Language;
17 import eu.etaxonomy.cdm.model.description.CommonTaxonName;
18 import eu.etaxonomy.taxeditor.propertysheet.description.CommonNamePropertySource;
19
20 /**
21 * @author p.ciardelli
22 * @created 02.04.2009
23 * @version 1.0
24 */
25 public class CommonNameComposite extends DescriptionElementComposite {
26
27 /**
28 * @param groupComposite
29 * @param groupComposite
30 * @param element
31 */
32 public CommonNameComposite(TaxonDescriptionEditor editor, Composite groupComposite,
33 CommonTaxonName element) {
34 super(editor, groupComposite, element);
35
36 setLanguageInfo();
37 }
38
39 /**
40 *
41 */
42 private void setLanguageInfo() {
43
44 Language language = ((CommonTaxonName) element).getLanguage();
45 if (language != null) {
46 setNonEditableInfo(language.getDescription());
47 } else {
48 setNonEditableInfo("No language");
49 }
50 }
51
52 public IPropertySource getPropertySource() {
53 return new CommonNamePropertySource((CommonTaxonName) getElement());
54 }
55 }