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