Merge branch 'release/4.5.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / view / descriptive / DescriptionElementTransfer.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
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.
8 */
9
10 package eu.etaxonomy.taxeditor.editor.view.descriptive;
11
12 import java.util.UUID;
13
14 import eu.etaxonomy.cdm.api.service.IDescriptionService;
15 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
16 import eu.etaxonomy.taxeditor.model.CdmObjectTransfer;
17 import eu.etaxonomy.taxeditor.store.CdmStore;
18
19 /**
20 * @author n.hoffmann
21 * @created Feb 8, 2011
22 * @version 1.0
23 */
24 public class DescriptionElementTransfer extends CdmObjectTransfer<DescriptionElementBase> {
25
26 private static DescriptionElementTransfer instance = new DescriptionElementTransfer();
27 private static final String TYPE_NAME = "descriptionElement-transfer-format";
28 private static final int TYPEID = registerType(TYPE_NAME);
29
30 public static synchronized DescriptionElementTransfer getInstance(){
31 return instance;
32 }
33
34 private DescriptionElementTransfer(){}
35
36 /* (non-Javadoc)
37 * @see org.eclipse.swt.dnd.Transfer#getTypeIds()
38 */
39 @Override
40 protected int[] getTypeIds() {
41 return new int[] { TYPEID };
42 }
43
44 /* (non-Javadoc)
45 * @see org.eclipse.swt.dnd.Transfer#getTypeNames()
46 */
47 @Override
48 protected String[] getTypeNames() {
49 return new String[] { TYPE_NAME };
50 }
51
52 /* (non-Javadoc)
53 * @see eu.etaxonomy.taxeditor.model.CdmObjectTransfer#loadElement(java.util.UUID)
54 */
55 @Override
56 public DescriptionElementBase loadElement(UUID uuid) {
57 return CdmStore.getService(IDescriptionService.class).loadDescriptionElement(uuid, null);
58 }
59 }