Merge branch 'release/4.3.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / input / NameRelationshipEditorInput.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.bulkeditor.input;
12
13 import java.util.Arrays;
14 import java.util.List;
15 import java.util.UUID;
16
17 import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
18 import eu.etaxonomy.cdm.model.name.NameRelationship;
19 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
20 import eu.etaxonomy.taxeditor.model.MessagingUtils;
21 import eu.etaxonomy.taxeditor.store.CdmStore;
22
23 /**
24 * <p>NameRelationshipEditorInput class.</p>
25 *
26 * @author n.hoffmann
27 * @created Oct 19, 2010
28 * @version 1.0
29 */
30 public class NameRelationshipEditorInput extends AbstractBulkEditorInput<NameRelationship> {
31
32 /**
33 *
34 */
35 private static final long serialVersionUID = -7453923697752787687L;
36
37 /** Constant <code>ID="bulkeditor.input.nameRelationship"</code> */
38 public static final String ID = "bulkeditor.input.nameRelationship";
39
40 private static NameRelationshipEditorInput instance;
41
42 /**
43 * <p>Getter for the field <code>instance</code>.</p>
44 *
45 * @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
46 */
47 public static AbstractBulkEditorInput<NameRelationship> getInstance(){
48 if(instance == null){
49 instance = new NameRelationshipEditorInput();
50 }
51 return instance;
52 }
53
54 /* (non-Javadoc)
55 * @see org.eclipse.ui.IEditorInput#getName()
56 */
57 /** {@inheritDoc} */
58 @Override
59 public String getName() {
60 return BulkEditorInputType.NAME_RELATIONSHIP.label;
61 }
62
63 /* (non-Javadoc)
64 * @see org.eclipse.ui.IEditorInput#getToolTipText()
65 */
66 /** {@inheritDoc} */
67 @Override
68 public String getToolTipText() {
69 return getName();
70 }
71
72 /* (non-Javadoc)
73 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#save(java.lang.Object)
74 */
75 /** {@inheritDoc} */
76 @Override
77 public NameRelationship save(NameRelationship entity) {
78 // TODO Auto-generated method stub
79 return null;
80 }
81
82 /* (non-Javadoc)
83 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#delete(java.lang.Object)
84 */
85 /** {@inheritDoc} */
86 @Override
87 public boolean delete(NameRelationship entity) {
88 // TODO Auto-generated method stub
89 return false;
90 }
91
92 /* (non-Javadoc)
93 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#listEntities(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
94 */
95 /** {@inheritDoc} */
96 @Override
97 protected List<NameRelationship> listEntities(
98 IIdentifiableEntityServiceConfigurator configurator) {
99 return CdmStore.getSearchManager().findNameRelationships(configurator);
100 }
101
102 /* (non-Javadoc)
103 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
104 */
105 /** {@inheritDoc} */
106 @Override
107 protected NameRelationship loadEntity(UUID entityUuid) {
108 List<String> propertyPaths = Arrays.asList(new String[]{});
109 return null; // CdmStore.getNameService().load(entityUuid, propertyPaths);
110 }
111
112 /* (non-Javadoc)
113 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
114 */
115 @Override
116 protected IEntityCreator<NameRelationship> createEntityCreator() {
117 MessagingUtils.notImplementedMessage(getClass());
118 return null;
119 }
120
121 /* (non-Javadoc)
122 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getTypeText(java.lang.Object)
123 */
124 @Override
125 public String getTypeText(Object entity) {
126 if(entity instanceof NameRelationship){
127 return ((NameRelationship) entity).getType().getTitleCache();
128 }
129
130 return super.getTypeText(entity);
131 }
132
133 /* (non-Javadoc)
134 * @see eu.etaxonomy.taxeditor.editor.CdmEntitySessionInput#merge()
135 */
136 @Override
137 public void merge() {
138
139 }
140
141 }