3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.bulkeditor
.input
;
13 import java
.util
.ArrayList
;
14 import java
.util
.Arrays
;
15 import java
.util
.List
;
16 import java
.util
.UUID
;
18 import eu
.etaxonomy
.cdm
.api
.service
.INameService
;
19 import eu
.etaxonomy
.cdm
.api
.service
.config
.IIdentifiableEntityServiceConfigurator
;
20 import eu
.etaxonomy
.cdm
.model
.common
.RelationshipBase
;
21 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
22 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.IEntityCreator
;
23 import eu
.etaxonomy
.taxeditor
.bulkeditor
.BulkEditorUtil
;
24 import eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.BulkEditorInputTypeValues
.BulkEditorInputType
;
25 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
28 * <p>NameRelationshipEditorInput class.</p>
31 * @created Oct 19, 2010
34 public class NameRelationshipEditorInput
extends AbstractBulkEditorInput
<NameRelationship
> {
39 private static final long serialVersionUID
= -7453923697752787687L;
41 /** Constant <code>ID="bulkeditor.input.nameRelationship"</code> */
42 public static final String ID
= "bulkeditor.input.nameRelationship";
44 private static NameRelationshipEditorInput instance
;
47 * <p>Getter for the field <code>instance</code>.</p>
49 * @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
51 public static AbstractBulkEditorInput
<NameRelationship
> getInstance(){
53 instance
= new NameRelationshipEditorInput();
59 * @see org.eclipse.ui.IEditorInput#getName()
63 public String
getName() {
64 return BulkEditorInputType
.NAME_RELATIONSHIP
.label
;
68 * @see org.eclipse.ui.IEditorInput#getToolTipText()
72 public String
getToolTipText() {
77 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#save(java.lang.Object)
81 public boolean save(NameRelationship entity
) {
82 // TODO Auto-generated method stub
87 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#delete(java.lang.Object)
91 public boolean delete(NameRelationship entity
) {
92 // TODO Auto-generated method stub
97 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#listEntities(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
101 protected List
<NameRelationship
> listEntities(
102 IIdentifiableEntityServiceConfigurator configurator
) {
103 return CdmStore
.getSearchManager().findNameRelationships(configurator
);
107 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
111 protected NameRelationship
loadEntity(UUID entityUuid
) {
112 List
<String
> propertyPaths
= Arrays
.asList(new String
[]{});
113 return null; // CdmStore.getNameService().load(entityUuid, propertyPaths);
117 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
120 protected IEntityCreator
<NameRelationship
> createEntityCreator() {
121 BulkEditorUtil
.notImplementedMessage(getClass());
126 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getTypeText(java.lang.Object)
129 public String
getTypeText(Object entity
) {
130 if(entity
instanceof NameRelationship
){
131 return ((NameRelationship
) entity
).getType().getTitleCache();
134 return super.getTypeText(entity
);