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 eu
.etaxonomy
.cdm
.api
.service
.IGroupService
;
18 import eu
.etaxonomy
.cdm
.api
.service
.config
.IIdentifiableEntityServiceConfigurator
;
19 import eu
.etaxonomy
.cdm
.api
.service
.exception
.ReferencedObjectUndeletableException
;
20 import eu
.etaxonomy
.cdm
.model
.common
.Group
;
21 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.IEntityCreator
;
22 import eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.entitycreator
.GroupCreator
;
23 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 * @created Mar 9, 2011
30 public class GroupEditorInput
extends AbstractBulkEditorInput
<Group
> {
32 public static final String ID
= "bulkeditor.input.group";
34 private static GroupEditorInput instance
;
37 * @return the instance
39 public static GroupEditorInput
getInstance() {
41 instance
= new GroupEditorInput();
47 * @see org.eclipse.ui.IEditorInput#getName()
50 public String
getName() {
51 return BulkEditorInputType
.GROUP
.label
;
55 * @see org.eclipse.ui.IEditorInput#getToolTipText()
58 public String
getToolTipText() {
63 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#save(java.lang.Object)
66 public boolean save(Group entity
) {
67 return CdmStore
.getService(IGroupService
.class).saveOrUpdate(entity
) != null;
71 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityPersistenceService#delete(java.lang.Object)
74 public boolean delete(Group entity
) throws ReferencedObjectUndeletableException
{
75 return CdmStore
.getService(IGroupService
.class).delete(entity
) != null;
79 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#listEntities(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
82 protected List
<Group
> listEntities(
83 IIdentifiableEntityServiceConfigurator configurator
) {
84 return CdmStore
.getSearchManager().findGroups(configurator
);
88 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#loadEntity(java.util.UUID)
91 protected Group loadEntity(UUID entityUuid) {
92 List<String> propertyPaths = Arrays.asList(new String[]{});
93 return CdmStore.getService(IGroupService.class).load(entityUuid, propertyPaths);
97 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#createEntityCreator()
100 protected IEntityCreator
<Group
> createEntityCreator() {
101 return new GroupCreator();
105 * @see eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput#getText(eu.etaxonomy.cdm.model.common.ICdmBase)
108 public String
getText(Group entity
) {
109 return entity
.getName();