+++ /dev/null
-// $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.model;
-
-import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
-import eu.etaxonomy.cdm.model.agent.Person;
-import eu.etaxonomy.cdm.model.agent.Team;
-import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
-
-/**
- * Utility class for handling of authorship related elements.
- *
- * @author n.hoffmann
- * @created Sep 8, 2010
- * @version 1.0
- */
-public class AuthorHelper {
-
- /**
- * If the given {@link TeamOrPersonBase} is a {@link Person} this methods
- * creates a new {@link Team} with this person. If it already a team the
- * team is returned.
- *
- * @param teamOrPerson
- * a team or a person
- * @return the given team or a newly created team with the given person
- */
- public static Team getAuthor(TeamOrPersonBase<?> teamOrPerson){
- if(teamOrPerson == null){
- return null;
- }
- Object deproxiedObject = HibernateProxyHelper.deproxy(teamOrPerson);
- if(deproxiedObject instanceof Person){
- Person person = (Person) deproxiedObject;
- Team team = Team.NewInstance();
- team.addTeamMember(person);
- return team;
- }
- else if(deproxiedObject instanceof Team){
- return (Team) deproxiedObject;
- }else{
- throw new IllegalArgumentException("Given object os of the wrong type");
- }
- }
-}
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
import eu.etaxonomy.cdm.model.reference.ReferenceType;
-import eu.etaxonomy.taxeditor.model.AuthorHelper;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
selection_authorTeam = formFactory
.createSelectionElement(AgentBase.class,
getConversationHolder(), formElement, "Author",
- AuthorHelper.getAuthor(entity.getAuthorship()),
+ entity.getAuthorship(),
EntitySelectionElement.ALL, style);
ReferenceType referenceType = entity.getType();
}
}
}
-
+
@Override
protected void handleToggleableCacheField() {
-
+
boolean pushedState = toggleable_cache.getState();
getEntity().setTitleCache(toggleable_cache.getText(), pushedState);
setIrrelevantReferenceDetail(false);
updateToggleableCacheField();
}
-
+
protected void setIrrelevantReferenceDetail(boolean abbrev){
-
+
List<Object> except = new ArrayList();
except.addAll( Arrays.asList(new Object[] { toggleable_cache, toggleableAbbrevCache, text_editor, text_isbn, text_issn, text_organisation, text_pages, text_placePublished, text_publisher, text_referenceAbstract, text_uri, selection_institution}));
boolean pushedState;
break;
default:
break;
- }
+ }
setIrrelevant(pushedState, except);
}
}