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.
10 package eu
.etaxonomy
.taxeditor
.bulkeditor
.input
;
12 import java
.util
.Arrays
;
13 import java
.util
.List
;
14 import java
.util
.UUID
;
16 import eu
.etaxonomy
.cdm
.api
.service
.config
.IIdentifiableEntityServiceConfigurator
;
17 import eu
.etaxonomy
.cdm
.model
.agent
.AgentBase
;
18 import eu
.etaxonomy
.taxeditor
.bulkeditor
.command
.BulkEditorInputTypeValues
.BulkEditorInputType
;
19 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
23 * <p>AgentEditorInput class.</p>
29 public class AgentEditorInput
extends AbstractBulkEditorInput
<AgentBase
> {
31 /** Constant <code>ID="bulkeditor.input.author"</code> */
32 public static final String ID
= "bulkeditor.input.author";
34 private static AgentEditorInput instance
;
37 * <p>Constructor for AgentEditorInput.</p>
39 public AgentEditorInput() {
48 public static String
getID() {
53 * @see org.eclipse.ui.IEditorInput#getName()
58 * @return a {@link java.lang.String} object.
60 public String
getName() {
61 return BulkEditorInputType
.AGENT
.label
;
65 * @see org.eclipse.ui.IEditorInput#getToolTipText()
68 * <p>getToolTipText</p>
70 * @return a {@link java.lang.String} object.
72 public String
getToolTipText() {
77 * <p>Getter for the field <code>instance</code>.</p>
79 * @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
81 public static AbstractBulkEditorInput
getInstance() {
82 if (instance
== null) {
83 instance
= new AgentEditorInput();
89 * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled()
93 public boolean isMergingEnabled() {
99 public List
listEntities(IIdentifiableEntityServiceConfigurator configurator
) {
100 return CdmStore
.findTeamOrPersons(configurator
);
105 public AgentBase
loadEntity(UUID uuid
) {
106 List
<String
> propertyPaths
= Arrays
.asList(new String
[]{});
107 return CdmStore
.getAgentService().load(uuid
, propertyPaths
);
111 public boolean delete(Object entity
) {
112 return CdmStore
.getAgentService().delete((AgentBase
) entity
) != null;
116 public boolean save(Object entity
) {
117 return CdmStore
.getAgentService().saveOrUpdate((AgentBase
) entity
) != null;