-// $Id$\r
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.taxeditor.bulkeditor.input;\r
-\r
-import java.util.Arrays;\r
-import java.util.List;\r
-import java.util.UUID;\r
-\r
-import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;\r
-import eu.etaxonomy.cdm.model.common.MarkerType;\r
-import eu.etaxonomy.cdm.model.reference.ReferenceBase;\r
-import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;\r
-import eu.etaxonomy.taxeditor.store.CdmStore;\r
-\r
-\r
-/**\r
- * @author p.ciardelli\r
- * @created 25.06.2009\r
- * @version 1.0\r
- */\r
-public class ReferenceEditorInput extends AbstractBulkEditorInput<ReferenceBase> {\r
-\r
- /**\r
- * \r
- */\r
- private static final long serialVersionUID = 3806243517765126749L;\r
-\r
- public static final String ID = "bulkeditor.input.reference";\r
- \r
- private static ReferenceEditorInput instance;\r
-\r
- /**\r
- * @param sourceBean\r
- */\r
- public ReferenceEditorInput() {\r
- super(new Object());\r
- }\r
-\r
- /**\r
- * @return the iD\r
- */\r
- public static String getID() {\r
- return ID;\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see org.eclipse.ui.IEditorInput#getName()\r
- */\r
- public String getName() {\r
- return BulkEditorInputType.REFERENCE.label;\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see org.eclipse.ui.IEditorInput#getToolTipText()\r
- */\r
- public String getToolTipText() {\r
- return getName();\r
- }\r
-\r
- /**\r
- * @return\r
- */\r
- public static AbstractBulkEditorInput getInstance() {\r
- if (instance == null) {\r
- instance = new ReferenceEditorInput();\r
- }\r
- return instance;\r
- }\r
-\r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled()\r
- */\r
- @Override\r
- public boolean isMergingEnabled() {\r
- return true;\r
- }\r
- \r
- /* (non-Javadoc)\r
- * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMarkerTypeEditingEnabled(eu.etaxonomy.cdm.model.common.MarkerType)\r
- */\r
- @Override\r
- public boolean isMarkerTypeEditingEnabled(MarkerType markerType) {\r
- if (MarkerType.PUBLISH().equals(markerType)) {\r
- return true;\r
- }\r
- return super.isMarkerTypeEditingEnabled(markerType);\r
- }\r
-\r
- // Entity persistence\r
- \r
- @Override\r
- public List listEntities(IIdentifiableEntityServiceConfigurator configurator) {\r
- return CdmStore.findReferences(configurator);\r
- }\r
-\r
- @Override\r
- public ReferenceBase loadEntity(UUID entityUuid) {\r
- List<String> propertyPaths = Arrays.asList(new String[]{"*", "inReference.*", "authorTeam.*"}); \r
- return CdmStore.getReferenceService().load(entityUuid, propertyPaths);\r
- }\r
-\r
- public boolean delete(Object entity) {\r
- return CdmStore.getReferenceService().delete((ReferenceBase) entity) != null;\r
- }\r
-\r
- public boolean save(Object entity) {\r
- return CdmStore.getReferenceService().saveOrUpdate((ReferenceBase) entity) != null;\r
- }\r
-}
\ No newline at end of file
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.bulkeditor.input;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.reference.ReferenceBase;
+import eu.etaxonomy.taxeditor.bulkeditor.command.BulkEditorInputTypeValues.BulkEditorInputType;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+
+/**
+ * <p>ReferenceEditorInput class.</p>
+ *
+ * @author p.ciardelli
+ * @created 25.06.2009
+ * @version 1.0
+ */
+public class ReferenceEditorInput extends AbstractBulkEditorInput<ReferenceBase> {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 3806243517765126749L;
+
+ /** Constant <code>ID="bulkeditor.input.reference"</code> */
+ public static final String ID = "bulkeditor.input.reference";
+
+ private static ReferenceEditorInput instance;
+
+ /**
+ * <p>Constructor for ReferenceEditorInput.</p>
+ */
+ public ReferenceEditorInput() {
+ super(new Object());
+ }
+
+ /**
+ * <p>getID</p>
+ *
+ * @return the iD
+ */
+ public static String getID() {
+ return ID;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getName()
+ */
+ /**
+ * <p>getName</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getName() {
+ return BulkEditorInputType.REFERENCE.label;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IEditorInput#getToolTipText()
+ */
+ /**
+ * <p>getToolTipText</p>
+ *
+ * @return a {@link java.lang.String} object.
+ */
+ public String getToolTipText() {
+ return getName();
+ }
+
+ /**
+ * <p>Getter for the field <code>instance</code>.</p>
+ *
+ * @return a {@link eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput} object.
+ */
+ public static AbstractBulkEditorInput getInstance() {
+ if (instance == null) {
+ instance = new ReferenceEditorInput();
+ }
+ return instance;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMergingEnabled()
+ */
+ /** {@inheritDoc} */
+ @Override
+ public boolean isMergingEnabled() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInput#isMarkerTypeEditingEnabled(eu.etaxonomy.cdm.model.common.MarkerType)
+ */
+ /** {@inheritDoc} */
+ @Override
+ public boolean isMarkerTypeEditingEnabled(MarkerType markerType) {
+ if (MarkerType.PUBLISH().equals(markerType)) {
+ return true;
+ }
+ return super.isMarkerTypeEditingEnabled(markerType);
+ }
+
+ // Entity persistence
+
+ /** {@inheritDoc} */
+ @Override
+ public List listEntities(IIdentifiableEntityServiceConfigurator configurator) {
+ return CdmStore.findReferences(configurator);
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public ReferenceBase loadEntity(UUID entityUuid) {
+ List<String> propertyPaths = Arrays.asList(new String[]{"*", "inReference.*", "authorTeam.*"});
+ return CdmStore.getReferenceService().load(entityUuid, propertyPaths);
+ }
+
+ /** {@inheritDoc} */
+ public boolean delete(Object entity) {
+ return CdmStore.getReferenceService().delete((ReferenceBase) entity) != null;
+ }
+
+ /** {@inheritDoc} */
+ public boolean save(Object entity) {
+ return CdmStore.getReferenceService().saveOrUpdate((ReferenceBase) entity) != null;
+ }
+}