Project

General

Profile

Download (1.55 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2009 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
package eu.etaxonomy.taxeditor.editor.definedterm;
10

    
11
import java.util.UUID;
12

    
13
import eu.etaxonomy.cdm.api.service.ITermService;
14
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
15
import eu.etaxonomy.taxeditor.model.CdmObjectTransfer;
16
import eu.etaxonomy.taxeditor.store.CdmStore;
17

    
18
/**
19
 * @author l.morris
20
 * @date 10 Jan 2012
21
 *
22
 */
23
public class TermTransfer extends CdmObjectTransfer<DefinedTermBase> {
24
	
25
	private static TermTransfer instance = new TermTransfer();
26
	private static final String TYPE_NAME = "termElement-transfer-format";
27
	private static final int TYPEID = registerType(TYPE_NAME);
28
	
29
	public static synchronized TermTransfer getInstance(){
30
		return instance;
31
	}
32
	
33
	private TermTransfer() {}
34

    
35
	/* (non-Javadoc)
36
	 * @see eu.etaxonomy.taxeditor.model.CdmObjectTransfer#loadElement(java.util.UUID)
37
	 */
38
	@Override
39
	public DefinedTermBase loadElement(UUID uuid) {
40
		return CdmStore.getService(ITermService.class).load(uuid);
41
	}
42

    
43
	/* (non-Javadoc)
44
	 * @see org.eclipse.swt.dnd.Transfer#getTypeIds()
45
	 */
46
	@Override
47
	protected int[] getTypeIds() {
48
		return new int[] { TYPEID };
49
	}
50

    
51
	/* (non-Javadoc)
52
	 * @see org.eclipse.swt.dnd.Transfer#getTypeNames()
53
	 */
54
	@Override
55
	protected String[] getTypeNames() {
56
		return new String[] { TYPE_NAME };
57
	}
58

    
59
}
(6-6/6)