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
.Arrays
;
14 import java
.util
.List
;
15 import java
.util
.UUID
;
17 import org
.apache
.log4j
.Logger
;
19 import eu
.etaxonomy
.cdm
.api
.service
.config
.IIdentifiableEntityServiceConfigurator
;
20 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
21 import eu
.etaxonomy
.taxeditor
.bulkeditor
.command
.BulkEditorInputTypeValues
.BulkEditorInputType
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * <p>NameEditorInput class.</p>
31 public class NameEditorInput
extends AbstractBulkEditorInput
<TaxonNameBase
> {
32 private static final Logger logger
= Logger
33 .getLogger(NameEditorInput
.class);
35 private static NameEditorInput instance
;
38 * <p>Constructor for NameEditorInput.</p>
40 public NameEditorInput() {
44 /** Constant <code>ID="bulkeditor.input.name"</code> */
45 public static final String ID
= "bulkeditor.input.name";
48 * <p>Getter for the field <code>instance</code>.</p>
50 * @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
52 public static AbstractBulkEditorInput
getInstance() {
53 if (instance
== null) {
54 instance
= new NameEditorInput();
60 * @see org.eclipse.ui.IEditorInput#getName()
65 * @return a {@link java.lang.String} object.
67 public String
getName() {
68 return BulkEditorInputType
.NAME
.label
;
72 * @see org.eclipse.ui.IEditorInput#getToolTipText()
75 * <p>getToolTipText</p>
77 * @return a {@link java.lang.String} object.
79 public String
getToolTipText() {
86 * @return a {@link java.lang.Object} object.
88 public static Object
getID() {
93 * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled()
97 public boolean isMergingEnabled() {
103 public List
listEntities(IIdentifiableEntityServiceConfigurator configurator
) {
104 return CdmStore
.findNames(configurator
);
109 public TaxonNameBase
loadEntity(UUID uuid
) {
110 List
<String
> propertyPaths
= Arrays
.asList(new String
[]{});
111 return CdmStore
.getNameService().load(uuid
, propertyPaths
);
115 public boolean delete(Object entity
) {
116 return CdmStore
.getNameService().delete((TaxonNameBase
) entity
) != null;
120 public boolean save(Object entity
) {
121 return CdmStore
.getNameService().saveOrUpdate((TaxonNameBase
) entity
) != null;