eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitBaseWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitDetailsWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitFacadeDetailSection.java -text
+ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailElement.java -text
+ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DerivedUnitGeneralDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationEventDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/DeterminationHistoryDetailSection.java -text
- eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailElement.java -text
- eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailSection.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationDetailsWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldObservationGeneralWizardPage.java -text
+ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitDetailElement.java -text
+ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitDetailSection.java -text
+ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailElement.java -text
+ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitGeneralDetailSection.java -text
+ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/FieldUnitWizardPage.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailSection.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventWizardPage.java -text
-eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralWizardPage.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GatheringEventDetailsWizardPage.java -text
- eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailElement.java -text
- eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/GeneralDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/IDerivedUnitFacadeDetailSection.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/NamedAreaDetailElement.java -text
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/occurrence/SourceCollectionDetailSection.java -text
--- /dev/null
+// $Id$
+/**
+* Copyright (C) 2013 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.dataimport.transientServices;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.apache.lucene.index.CorruptIndexException;
+import org.apache.lucene.queryParser.ParseException;
+import org.hibernate.LockMode;
+import org.hibernate.Session;
+import org.hibernate.criterion.Criterion;
+import org.hibernate.envers.query.criteria.AuditCriterion;
+
+import eu.etaxonomy.cdm.api.service.ITaxonService;
+import eu.etaxonomy.cdm.api.service.TaxaAndNamesSearchMode;
+import eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator;
+import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator;
+import eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator;
+import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.exception.DataChangeNoRollbackException;
+import eu.etaxonomy.cdm.api.service.exception.HomotypicalGroupChangeException;
+import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.api.service.search.LuceneMultiSearchException;
+import eu.etaxonomy.cdm.api.service.search.SearchResult;
+import eu.etaxonomy.cdm.api.service.util.TaxonRelationshipEdge;
+import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.ISourceable;
+import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
+import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+import eu.etaxonomy.cdm.model.common.LSID;
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
+import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;
+import eu.etaxonomy.cdm.model.common.RelationshipBase;
+import eu.etaxonomy.cdm.model.common.RelationshipBase.Direction;
+import eu.etaxonomy.cdm.model.common.UuidAndTitleCache;
+import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.Feature;
+import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
+import eu.etaxonomy.cdm.model.location.NamedArea;
+import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.cdm.model.media.MediaRepresentation;
+import eu.etaxonomy.cdm.model.media.Rights;
+import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
+import eu.etaxonomy.cdm.model.name.Rank;
+import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.taxon.Classification;
+import eu.etaxonomy.cdm.model.taxon.Synonym;
+import eu.etaxonomy.cdm.model.taxon.SynonymRelationship;
+import eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType;
+import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.cdm.model.taxon.TaxonBase;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
+import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
+import eu.etaxonomy.cdm.model.view.AuditEvent;
+import eu.etaxonomy.cdm.model.view.AuditEventRecord;
+import eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort;
+import eu.etaxonomy.cdm.persistence.fetch.CdmFetch;
+import eu.etaxonomy.cdm.persistence.query.Grouping;
+import eu.etaxonomy.cdm.persistence.query.MatchMode;
+import eu.etaxonomy.cdm.persistence.query.OrderHint;
+import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
+import eu.etaxonomy.cdm.strategy.match.IMatchStrategy;
+import eu.etaxonomy.cdm.strategy.merge.IMergeStrategy;
+
+/**
+ * @author pplitzner
+ * @date 27.09.2013
+ *
+ */
+public class TransientTaxonService implements ITaxonService {
+
+ private final ITaxonService defaultTaxonService;
+
+ /**
+ * @param defaultTaxonService
+ */
+ public TransientTaxonService(ITaxonService defaultTaxonService) {
+ this.defaultTaxonService = defaultTaxonService;
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(eu.etaxonomy.cdm.model.common.VersionableEntity, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<TaxonBase>> pageAuditEvents(TaxonBase t, Integer pageSize, Integer pageNumber, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultTaxonService.pageAuditEvents(t, pageSize, pageNumber, sort, propertyPaths);
+ }
+
+ /**
+ * @param annotatedObj
+ * @param status
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getAnnotations(eu.etaxonomy.cdm.model.common.AnnotatableEntity, eu.etaxonomy.cdm.model.common.MarkerType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Annotation> getAnnotations(TaxonBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.getAnnotations(annotatedObj, status, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IService#clear()
+ */
+ @Override
+ public void clear() {
+ defaultTaxonService.clear();
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @see eu.etaxonomy.cdm.api.service.IService#lock(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode)
+ */
+ @Override
+ public void lock(TaxonBase t, LockMode lockMode) {
+ defaultTaxonService.lock(t, lockMode);
+ }
+
+ /**
+ * @param t
+ * @param lockMode
+ * @param propertyPaths
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase, org.hibernate.LockMode, java.util.List)
+ */
+ @Override
+ public void refresh(TaxonBase t, LockMode lockMode, List<String> propertyPaths) {
+ defaultTaxonService.refresh(t, lockMode, propertyPaths);
+ }
+
+ /**
+ *
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache()
+ */
+ @Override
+ public void updateTitleCache() {
+ defaultTaxonService.updateTitleCache();
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getNextAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<TaxonBase> getNextAuditEvent(TaxonBase t) {
+ return defaultTaxonService.getNextAuditEvent(t);
+ }
+
+ /**
+ * @param annotatableEntity
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#getMarkers(eu.etaxonomy.cdm.model.common.AnnotatableEntity, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<Marker> getMarkers(TaxonBase annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.getMarkers(annotatableEntity, technical, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param stepSize
+ * @param cacheStrategy
+ * @param monitor
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Class, java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy, eu.etaxonomy.cdm.common.monitor.IProgressMonitor)
+ */
+ @Override
+ public void updateTitleCache(Class<? extends TaxonBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<TaxonBase> cacheStrategy, IProgressMonitor monitor) {
+ defaultTaxonService.updateTitleCache(clazz, stepSize, cacheStrategy, monitor);
+ }
+
+ /**
+ * @param t
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#getPreviousAuditEvent(eu.etaxonomy.cdm.model.common.VersionableEntity)
+ */
+ @Override
+ public AuditEventRecord<TaxonBase> getPreviousAuditEvent(TaxonBase t) {
+ return defaultTaxonService.getPreviousAuditEvent(t);
+ }
+
+ /**
+ * @param clazz
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#count(java.lang.Class)
+ */
+ @Override
+ public int count(Class<? extends TaxonBase> clazz) {
+ return defaultTaxonService.count(clazz);
+ }
+
+ /**
+ * @param clazz
+ * @param from
+ * @param to
+ * @param criteria
+ * @param pageSize
+ * @param pageValue
+ * @param sort
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IVersionableService#pageAuditEvents(java.lang.Class, eu.etaxonomy.cdm.model.view.AuditEvent, eu.etaxonomy.cdm.model.view.AuditEvent, java.util.List, java.lang.Integer, java.lang.Integer, eu.etaxonomy.cdm.persistence.dao.common.AuditEventSort, java.util.List)
+ */
+ @Override
+ public Pager<AuditEventRecord<TaxonBase>> pageAuditEvents(Class<? extends TaxonBase> clazz, AuditEvent from, AuditEvent to, List<AuditCriterion> criteria, Integer pageSize, Integer pageValue, AuditEventSort sort, List<String> propertyPaths) {
+ return defaultTaxonService.pageAuditEvents(clazz, from, to, criteria, pageSize, pageValue, sort, propertyPaths);
+ }
+
+ /**
+ * @param lsid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#find(eu.etaxonomy.cdm.model.common.LSID)
+ */
+ @Override
+ public TaxonBase find(LSID lsid) {
+ return defaultTaxonService.find(lsid);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#delete(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID delete(TaxonBase persistentObject) {
+ return defaultTaxonService.delete(persistentObject);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#groupMarkers(java.lang.Class, java.lang.Boolean, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Object[]> groupMarkers(Class<? extends TaxonBase> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTaxonService.groupMarkers(clazz, technical, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#exists(java.util.UUID)
+ */
+ @Override
+ public boolean exists(UUID uuid) {
+ return defaultTaxonService.exists(uuid);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getAllSynonyms(int, int)
+ */
+ @Override
+ public List<Synonym> getAllSynonyms(int limit, int start) {
+ return defaultTaxonService.getAllSynonyms(limit, start);
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#replace(eu.etaxonomy.cdm.model.common.IdentifiableEntity, eu.etaxonomy.cdm.model.common.IdentifiableEntity)
+ */
+ @Override
+ public TaxonBase replace(TaxonBase x, TaxonBase y) {
+ return defaultTaxonService.replace(x, y);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getAllTaxa(int, int)
+ */
+ @Override
+ public List<Taxon> getAllTaxa(int limit, int start) {
+ return defaultTaxonService.getAllTaxa(limit, start);
+ }
+
+ /**
+ * @param uuidSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.Set)
+ */
+ @Override
+ public List<TaxonBase> find(Set<UUID> uuidSet) {
+ return defaultTaxonService.find(uuidSet);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSources(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<IdentifiableSource> getSources(TaxonBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTaxonService.getSources(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param sec
+ * @param cdmFetch
+ * @param onlyWithChildren
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getRootTaxa(eu.etaxonomy.cdm.model.reference.Reference, eu.etaxonomy.cdm.persistence.fetch.CdmFetch, boolean)
+ */
+ @Deprecated
+ @Override
+ public List<Taxon> getRootTaxa(Reference sec, CdmFetch cdmFetch, boolean onlyWithChildren) {
+ return defaultTaxonService.getRootTaxa(sec, cdmFetch, onlyWithChildren);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(java.util.UUID)
+ */
+ @Override
+ public TaxonBase find(UUID uuid) {
+ return defaultTaxonService.find(uuid);
+ }
+
+ /**
+ * @param rank
+ * @param sec
+ * @param onlyWithChildren
+ * @param withMisapplications
+ * @param propertyPaths
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getRootTaxa(eu.etaxonomy.cdm.model.name.Rank, eu.etaxonomy.cdm.model.reference.Reference, boolean, boolean, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<Taxon> getRootTaxa(Rank rank, Reference sec, boolean onlyWithChildren, boolean withMisapplications, List<String> propertyPaths) {
+ return defaultTaxonService.getRootTaxa(rank, sec, onlyWithChildren, withMisapplications, propertyPaths);
+ }
+
+ /**
+ * @param id
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#find(int)
+ */
+ @Override
+ public TaxonBase find(int id) {
+ return defaultTaxonService.find(id);
+ }
+
+ /**
+ * @param t
+ * @param pageSize
+ * @param pageNumber
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getRights(eu.etaxonomy.cdm.model.common.IdentifiableEntity, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Pager<Rights> getRights(TaxonBase t, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ return defaultTaxonService.getRights(t, pageSize, pageNumber, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param technical
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IAnnotatableService#countMarkers(java.lang.Class, java.lang.Boolean)
+ */
+ @Override
+ public int countMarkers(Class<? extends TaxonBase> clazz, Boolean technical) {
+ return defaultTaxonService.countMarkers(clazz, technical);
+ }
+
+ /**
+ * @param idSet
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#findById(java.util.Set)
+ */
+ @Override
+ public List<TaxonBase> findById(Set<Integer> idSet) {
+ return defaultTaxonService.findById(idSet);
+ }
+
+ /**
+ * @param clazz
+ * @param idInSource
+ * @param idNamespace
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getSourcedObjectByIdInSource(java.lang.Class, java.lang.String, java.lang.String)
+ */
+ @Override
+ public ISourceable getSourcedObjectByIdInSource(Class clazz, String idInSource, String idNamespace) {
+ return defaultTaxonService.getSourcedObjectByIdInSource(clazz, idInSource, idNamespace);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#getSession()
+ */
+ @Override
+ public Session getSession() {
+ return defaultTaxonService.getSession();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#getUuidAndTitleCache()
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCache() {
+ return defaultTaxonService.getUuidAndTitleCache();
+ }
+
+ /**
+ * @param clazz
+ * @param limit
+ * @param start
+ * @param groups
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#group(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<Object[]> group(Class<? extends TaxonBase> clazz, Integer limit, Integer start, List<Grouping> groups, List<String> propertyPaths) {
+ return defaultTaxonService.group(clazz, limit, start, groups, propertyPaths);
+ }
+
+ /**
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getAllRelationships(int, int)
+ */
+ @Override
+ public List<RelationshipBase> getAllRelationships(int limit, int start) {
+ return defaultTaxonService.getAllRelationships(limit, start);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonBase> findByTitle(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.findByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getTaxonRelationshipTypeVocabulary()
+ */
+ @Deprecated
+ @Override
+ public OrderedTermVocabulary<TaxonRelationshipType> getTaxonRelationshipTypeVocabulary() {
+ return defaultTaxonService.getTaxonRelationshipTypeVocabulary();
+ }
+
+ /**
+ * @param name
+ * @param sec
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#searchTaxaByName(java.lang.String, eu.etaxonomy.cdm.model.reference.Reference)
+ */
+ @Override
+ public List<TaxonBase> searchTaxaByName(String name, Reference sec) {
+ return defaultTaxonService.searchTaxaByName(name, sec);
+ }
+
+ /**
+ * @param synonym
+ * @param acceptedTaxon
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#swapSynonymAndAcceptedTaxon(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon)
+ */
+ @Override
+ public void swapSynonymAndAcceptedTaxon(Synonym synonym, Taxon acceptedTaxon) {
+ defaultTaxonService.swapSynonymAndAcceptedTaxon(synonym, acceptedTaxon);
+ }
+
+ /**
+ * @param type
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> list(Class<? extends TaxonBase> type, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.list(type, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Pager<TaxonBase> findByTitle(IIdentifiableEntityServiceConfigurator<TaxonBase> configurator) {
+ return defaultTaxonService.findByTitle(configurator);
+ }
+
+ /**
+ * @param synonym
+ * @param acceptedTaxon
+ * @param deleteSynonym
+ * @param copyCitationInfo
+ * @param citation
+ * @param microCitation
+ * @return
+ * @throws HomotypicalGroupChangeException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToAcceptedTaxon(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, boolean, boolean, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
+ */
+ @Override
+ public Taxon changeSynonymToAcceptedTaxon(Synonym synonym, Taxon acceptedTaxon, boolean deleteSynonym, boolean copyCitationInfo, Reference citation, String microCitation) throws HomotypicalGroupChangeException {
+ return defaultTaxonService.changeSynonymToAcceptedTaxon(synonym, acceptedTaxon, deleteSynonym, copyCitationInfo, citation, microCitation);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List)
+ */
+ @Override
+ public Integer countByTitle(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria) {
+ return defaultTaxonService.countByTitle(clazz, queryString, matchmode, criteria);
+ }
+
+ /**
+ * @param uuid
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID)
+ */
+ @Override
+ public TaxonBase load(UUID uuid) {
+ return defaultTaxonService.load(uuid);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#load(java.util.UUID, java.util.List)
+ */
+ @Override
+ public TaxonBase load(UUID uuid, List<String> propertyPaths) {
+ return defaultTaxonService.load(uuid, propertyPaths);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#countByTitle(eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator)
+ */
+ @Override
+ public Integer countByTitle(IIdentifiableEntityServiceConfigurator<TaxonBase> configurator) {
+ return defaultTaxonService.countByTitle(configurator);
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#merge(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public TaxonBase merge(TaxonBase transientObject) {
+ return defaultTaxonService.merge(transientObject);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> listByTitle(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.listByTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#page(java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonBase> page(Class<? extends TaxonBase> type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.page(type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param persistentObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#refresh(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID refresh(TaxonBase persistentObject) {
+ return defaultTaxonService.refresh(persistentObject);
+ }
+
+ /**
+ * @param synonym
+ * @param toTaxon
+ * @param taxonRelationshipType
+ * @param reference
+ * @param microReference
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToRelatedTaxon(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
+ */
+ @Override
+ public Taxon changeSynonymToRelatedTaxon(Synonym synonym, Taxon toTaxon, TaxonRelationshipType taxonRelationshipType, Reference reference, String microReference) {
+ return defaultTaxonService.changeSynonymToRelatedTaxon(synonym, toTaxon, taxonRelationshipType, reference, microReference);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param matchmode
+ * @param criteria
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#listByReferenceTitle(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.persistence.query.MatchMode, java.util.List, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> listByReferenceTitle(Class<? extends TaxonBase> clazz, String queryString, MatchMode matchmode, List<Criterion> criteria, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.listByReferenceTitle(clazz, queryString, matchmode, criteria, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param tableName
+ * @param limit
+ * @param start
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#rows(java.lang.String, int, int)
+ */
+ @Override
+ public List<TaxonBase> rows(String tableName, int limit, int start) {
+ return defaultTaxonService.rows(tableName, limit, start);
+ }
+
+ /**
+ * @param newInstances
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, TaxonBase> save(Collection<TaxonBase> newInstances) {
+ return null;
+ }
+
+ /**
+ * @param syn
+ * @param taxon
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonymRelationships(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon)
+ */
+ @Override
+ public long deleteSynonymRelationships(Synonym syn, Taxon taxon) {
+ return defaultTaxonService.deleteSynonymRelationships(syn, taxon);
+ }
+
+ /**
+ * @param newInstance
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#save(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID save(TaxonBase newInstance) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID saveOrUpdate(TaxonBase transientObject) {
+ return null;
+ }
+
+ /**
+ * @param synonym
+ * @param newHomotypicalGroup
+ * @param targetTaxon
+ * @param removeFromOtherTaxa
+ * @param setBasionymRelationIfApplicable
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeHomotypicalGroupOfSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.name.HomotypicalGroup, eu.etaxonomy.cdm.model.taxon.Taxon, boolean, boolean)
+ */
+ @Override
+ public void changeHomotypicalGroupOfSynonym(Synonym synonym, HomotypicalGroup newHomotypicalGroup, Taxon targetTaxon, boolean removeFromOtherTaxa, boolean setBasionymRelationIfApplicable) {
+ defaultTaxonService.changeHomotypicalGroupOfSynonym(synonym, newHomotypicalGroup, targetTaxon, removeFromOtherTaxa, setBasionymRelationIfApplicable);
+ }
+
+ /**
+ * @param transientObjects
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#saveOrUpdate(java.util.Collection)
+ */
+ @Override
+ public Map<UUID, TaxonBase> saveOrUpdate(Collection<TaxonBase> transientObjects) {
+ return null;
+ }
+
+ /**
+ * @param transientObject
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#update(eu.etaxonomy.cdm.model.common.ICdmBase)
+ */
+ @Override
+ public UUID update(TaxonBase transientObject) {
+ return defaultTaxonService.update(transientObject);
+ }
+
+ /**
+ * @param example
+ * @param includeProperties
+ * @param limit
+ * @param start
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IService#list(eu.etaxonomy.cdm.model.common.ICdmBase, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonBase> list(TaxonBase example, Set<String> includeProperties, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.list(example, includeProperties, limit, start, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param oldSynonymRelation
+ * @param newTaxon
+ * @param moveHomotypicGroup
+ * @param newSynonymRelationshipType
+ * @param newReference
+ * @param newReferenceDetail
+ * @param keepReference
+ * @return
+ * @throws HomotypicalGroupChangeException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#moveSynonymToAnotherTaxon(eu.etaxonomy.cdm.model.taxon.SynonymRelationship, eu.etaxonomy.cdm.model.taxon.Taxon, boolean, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String, boolean)
+ */
+ @Override
+ public SynonymRelationship moveSynonymToAnotherTaxon(SynonymRelationship oldSynonymRelation, Taxon newTaxon, boolean moveHomotypicGroup, SynonymRelationshipType newSynonymRelationshipType, Reference newReference, String newReferenceDetail, boolean keepReference) throws HomotypicalGroupChangeException {
+ return defaultTaxonService.moveSynonymToAnotherTaxon(oldSynonymRelation, newTaxon, moveHomotypicGroup, newSynonymRelationshipType, newReference, newReferenceDetail, keepReference);
+ }
+
+ /**
+ * @param clazz
+ * @param matchStrategy
+ * @param mergeStrategy
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#deduplicate(java.lang.Class, eu.etaxonomy.cdm.strategy.match.IMatchStrategy, eu.etaxonomy.cdm.strategy.merge.IMergeStrategy)
+ */
+ @Override
+ public int deduplicate(Class<? extends TaxonBase> clazz, IMatchStrategy matchStrategy, IMergeStrategy mergeStrategy) {
+ return defaultTaxonService.deduplicate(clazz, matchStrategy, mergeStrategy);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param matchMode
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#findTitleCache(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, eu.etaxonomy.cdm.persistence.query.MatchMode)
+ */
+ @Override
+ public Pager<TaxonBase> findTitleCache(Class<? extends TaxonBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, MatchMode matchMode) {
+ return defaultTaxonService.findTitleCache(clazz, queryString, pageSize, pageNumber, orderHints, matchMode);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listToTaxonRelationships(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonRelationship> listToTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.listToTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#pageToTaxonRelationships(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonRelationship> pageToTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.pageToTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listFromTaxonRelationships(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public List<TaxonRelationship> listFromTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.listFromTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#pageFromTaxonRelationships(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonRelationship> pageFromTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.pageFromTaxonRelationships(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param includeRelationships
+ * @param maxDepth
+ * @param limit
+ * @param start
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listRelatedTaxa(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public Set<Taxon> listRelatedTaxa(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, Integer maxDepth, Integer limit, Integer start, List<String> propertyPaths) {
+ return defaultTaxonService.listRelatedTaxa(taxon, includeRelationships, maxDepth, limit, start, propertyPaths);
+ }
+
+ /**
+ * @param taxonBase
+ * @param limit
+ * @param start
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listClassifications(eu.etaxonomy.cdm.model.taxon.TaxonBase, java.lang.Integer, java.lang.Integer, java.util.List)
+ */
+ @Override
+ public List<Classification> listClassifications(TaxonBase taxonBase, Integer limit, Integer start, List<String> propertyPaths) {
+ return defaultTaxonService.listClassifications(taxonBase, limit, start, propertyPaths);
+ }
+
+ /**
+ * @param synonym
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getSynonyms(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SynonymRelationship> getSynonyms(Synonym synonym, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.getSynonyms(synonym, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getSynonyms(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SynonymRelationship> getSynonyms(Taxon taxon, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.getSynonyms(taxon, type, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getHomotypicSynonymsByHomotypicGroup(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.List)
+ */
+ @Override
+ public List<Synonym> getHomotypicSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths) {
+ return defaultTaxonService.getHomotypicSynonymsByHomotypicGroup(taxon, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getHeterotypicSynonymyGroups(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.List)
+ */
+ @Override
+ public List<List<Synonym>> getHeterotypicSynonymyGroups(Taxon taxon, List<String> propertyPaths) {
+ return defaultTaxonService.getHeterotypicSynonymyGroups(taxon, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#search(java.lang.Class, java.lang.String, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<TaxonBase> search(Class<? extends TaxonBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ return defaultTaxonService.search(clazz, queryString, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param uninomial
+ * @param infragenericEpithet
+ * @param specificEpithet
+ * @param infraspecificEpithet
+ * @param rank
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaByName(java.lang.Class, java.lang.String, java.lang.String, java.lang.String, java.lang.String, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber) {
+ return defaultTaxonService.findTaxaByName(clazz, uninomial, infragenericEpithet, specificEpithet, infraspecificEpithet, rank, pageSize, pageNumber);
+ }
+
+ /**
+ * @param clazz
+ * @param uninomial
+ * @param infragenericEpithet
+ * @param specificEpithet
+ * @param infraspecificEpithet
+ * @param rank
+ * @param pageSize
+ * @param pageNumber
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listTaxaByName(java.lang.Class, java.lang.String, java.lang.String, java.lang.String, java.lang.String, eu.etaxonomy.cdm.model.name.Rank, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public List<TaxonBase> listTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber) {
+ return defaultTaxonService.listTaxaByName(clazz, uninomial, infragenericEpithet, specificEpithet, infraspecificEpithet, rank, pageSize, pageNumber);
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaAndNames(eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator)
+ */
+ @Override
+ public Pager<IdentifiableEntity> findTaxaAndNames(IFindTaxaAndNamesConfigurator configurator) {
+ return defaultTaxonService.findTaxaAndNames(configurator);
+ }
+
+ /**
+ * @param queryString
+ * @param classification
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @throws LuceneMultiSearchException
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findByEverythingFullText(java.lang.String, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public Pager<SearchResult<TaxonBase>> findByEverythingFullText(String queryString, Classification classification, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
+ return defaultTaxonService.findByEverythingFullText(queryString, classification, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param classification
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findByFullText(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<TaxonBase>> findByFullText(Class<? extends TaxonBase> clazz, String queryString, Classification classification, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {
+ return defaultTaxonService.findByFullText(clazz, queryString, classification, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param areaFilter
+ * @param statusFilter
+ * @param classification
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findByDistribution(java.util.List, java.util.List, eu.etaxonomy.cdm.model.taxon.Classification, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<TaxonBase>> findByDistribution(List<NamedArea> areaFilter, List<PresenceAbsenceTermBase<?>> statusFilter, Classification classification, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws IOException, ParseException {
+ return defaultTaxonService.findByDistribution(areaFilter, statusFilter, classification, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param searchModes
+ * @param queryString
+ * @param classification
+ * @param namedAreas
+ * @param distributionStatus
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @throws LuceneMultiSearchException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaAndNamesByFullText(java.util.EnumSet, java.lang.String, eu.etaxonomy.cdm.model.taxon.Classification, java.util.Set, java.util.Set, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<TaxonBase>> findTaxaAndNamesByFullText(EnumSet<TaxaAndNamesSearchMode> searchModes, String queryString, Classification classification, Set<NamedArea> namedAreas, Set<PresenceAbsenceTermBase<?>> distributionStatus, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException, LuceneMultiSearchException {
+ return defaultTaxonService.findTaxaAndNamesByFullText(searchModes, queryString, classification, namedAreas, distributionStatus, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param clazz
+ * @param queryString
+ * @param classification
+ * @param features
+ * @param languages
+ * @param highlightFragments
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @return
+ * @throws CorruptIndexException
+ * @throws IOException
+ * @throws ParseException
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findByDescriptionElementFullText(java.lang.Class, java.lang.String, eu.etaxonomy.cdm.model.taxon.Classification, java.util.List, java.util.List, boolean, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List)
+ */
+ @Override
+ public Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(Class<? extends DescriptionElementBase> clazz, String queryString, Classification classification, List<Feature> features, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) throws CorruptIndexException, IOException, ParseException {
+ return defaultTaxonService.findByDescriptionElementFullText(clazz, queryString, classification, features, languages, highlightFragments, pageSize, pageNumber, orderHints, propertyPaths);
+ }
+
+ /**
+ * @param taxon
+ * @param size
+ * @param height
+ * @param widthOrDuration
+ * @param mimeTypes
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getAllMedia(eu.etaxonomy.cdm.model.taxon.Taxon, int, int, int, java.lang.String[])
+ */
+ @Deprecated
+ @Override
+ public List<MediaRepresentation> getAllMedia(Taxon taxon, int size, int height, int widthOrDuration, String[] mimeTypes) {
+ return defaultTaxonService.getAllMedia(taxon, size, height, widthOrDuration, mimeTypes);
+ }
+
+ /**
+ * @param taxon
+ * @param includeRelationships
+ * @param limitToGalleries
+ * @param propertyPath
+ * @return
+ * @deprecated
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listTaxonDescriptionMedia(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, boolean, java.util.List)
+ */
+ @Deprecated
+ @Override
+ public List<Media> listTaxonDescriptionMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, boolean limitToGalleries, List<String> propertyPath) {
+ return defaultTaxonService.listTaxonDescriptionMedia(taxon, includeRelationships, limitToGalleries, propertyPath);
+ }
+
+ /**
+ * @param taxon
+ * @param includeRelationships
+ * @param limitToGalleries
+ * @param includeTaxonDescriptions
+ * @param includeOccurrences
+ * @param includeTaxonNameDescriptions
+ * @param propertyPath
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listMedia(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.lang.Boolean, java.util.List)
+ */
+ @Override
+ public List<Media> listMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeTaxonNameDescriptions, List<String> propertyPath) {
+ return defaultTaxonService.listMedia(taxon, includeRelationships, limitToGalleries, includeTaxonDescriptions, includeOccurrences, includeTaxonNameDescriptions, propertyPath);
+ }
+
+ /**
+ * @param listOfIDs
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaByID(java.util.Set)
+ */
+ @Override
+ public List<TaxonBase> findTaxaByID(Set<Integer> listOfIDs) {
+ return defaultTaxonService.findTaxaByID(listOfIDs);
+ }
+
+ /**
+ * @param uuid
+ * @param propertyPaths
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxonByUuid(java.util.UUID, java.util.List)
+ */
+ @Override
+ public TaxonBase findTaxonByUuid(UUID uuid, List<String> propertyPaths) {
+ return defaultTaxonService.findTaxonByUuid(uuid, propertyPaths);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#countAllRelationships()
+ */
+ @Override
+ public int countAllRelationships() {
+ return defaultTaxonService.countAllRelationships();
+ }
+
+ /**
+ * @param propertyPath
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findIdenticalTaxonNames(java.util.List)
+ */
+ @Override
+ public List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPath) {
+ return defaultTaxonService.findIdenticalTaxonNames(propertyPath);
+ }
+
+ /**
+ * @param propertyPath
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findIdenticalTaxonNameIds(java.util.List)
+ */
+ @Override
+ public List<TaxonNameBase> findIdenticalTaxonNameIds(List<String> propertyPath) {
+ return defaultTaxonService.findIdenticalTaxonNameIds(propertyPath);
+ }
+
+ /**
+ * @param name
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getPhylumName(eu.etaxonomy.cdm.model.name.TaxonNameBase)
+ */
+ @Override
+ public String getPhylumName(TaxonNameBase name) {
+ return defaultTaxonService.getPhylumName(name);
+ }
+
+ /**
+ * @param syn
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonymRelationships(eu.etaxonomy.cdm.model.taxon.Synonym)
+ */
+ @Override
+ public long deleteSynonymRelationships(Synonym syn) {
+ return defaultTaxonService.deleteSynonymRelationships(syn);
+ }
+
+ /**
+ * @param taxonBase
+ * @param type
+ * @param pageSize
+ * @param pageNumber
+ * @param orderHints
+ * @param propertyPaths
+ * @param direction
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#listSynonymRelationships(eu.etaxonomy.cdm.model.taxon.TaxonBase, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, java.lang.Integer, java.lang.Integer, java.util.List, java.util.List, eu.etaxonomy.cdm.model.common.RelationshipBase.Direction)
+ */
+ @Override
+ public List<SynonymRelationship> listSynonymRelationships(TaxonBase taxonBase, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths, Direction direction) {
+ return defaultTaxonService.listSynonymRelationships(taxonBase, type, pageSize, pageNumber, orderHints, propertyPaths, direction);
+ }
+
+ /**
+ * @param taxonName
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findBestMatchingTaxon(java.lang.String)
+ */
+ @Override
+ public Taxon findBestMatchingTaxon(String taxonName) {
+ return defaultTaxonService.findBestMatchingTaxon(taxonName);
+ }
+
+ /**
+ * @param config
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findBestMatchingTaxon(eu.etaxonomy.cdm.api.service.config.MatchingTaxonConfigurator)
+ */
+ @Override
+ public Taxon findBestMatchingTaxon(MatchingTaxonConfigurator config) {
+ return defaultTaxonService.findBestMatchingTaxon(config);
+ }
+
+ /**
+ * @param taxonName
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findBestMatchingSynonym(java.lang.String)
+ */
+ @Override
+ public Synonym findBestMatchingSynonym(String taxonName) {
+ return defaultTaxonService.findBestMatchingSynonym(taxonName);
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getUuidAndTitleCacheTaxon()
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheTaxon() {
+ return defaultTaxonService.getUuidAndTitleCacheTaxon();
+ }
+
+ /**
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getUuidAndTitleCacheSynonym()
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheSynonym() {
+ return defaultTaxonService.getUuidAndTitleCacheSynonym();
+ }
+
+ /**
+ * @param configurator
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#findTaxaAndNamesForEditor(eu.etaxonomy.cdm.api.service.config.IFindTaxaAndNamesConfigurator)
+ */
+ @Override
+ public List<UuidAndTitleCache<TaxonBase>> findTaxaAndNamesForEditor(IFindTaxaAndNamesConfigurator configurator) {
+ return defaultTaxonService.findTaxaAndNamesForEditor(configurator);
+ }
+
+ /**
+ * @param taxon
+ * @param tree
+ * @param type
+ * @param doWithMisappliedNames
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#createInferredSynonyms(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType, boolean)
+ */
+ @Override
+ public List<Synonym> createInferredSynonyms(Taxon taxon, Classification tree, SynonymRelationshipType type, boolean doWithMisappliedNames) {
+ return defaultTaxonService.createInferredSynonyms(taxon, tree, type, doWithMisappliedNames);
+ }
+
+ /**
+ * @param taxon
+ * @param tree
+ * @param doWithMisappliedNames
+ * @return
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#createAllInferredSynonyms(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.model.taxon.Classification, boolean)
+ */
+ @Override
+ public List<Synonym> createAllInferredSynonyms(Taxon taxon, Classification tree, boolean doWithMisappliedNames) {
+ return defaultTaxonService.createAllInferredSynonyms(taxon, tree, doWithMisappliedNames);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
+ */
+ @Override
+ public void deleteSynonym(Synonym arg0, SynonymDeletionConfigurator arg1) {
+ defaultTaxonService.deleteSynonym(arg0, arg1);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteSynonym(eu.etaxonomy.cdm.model.taxon.Synonym, eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator)
+ */
+ @Override
+ public void deleteSynonym(Synonym arg0, Taxon arg1, SynonymDeletionConfigurator arg2) {
+ defaultTaxonService.deleteSynonym(arg0, arg1, arg2);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#deleteTaxon(eu.etaxonomy.cdm.model.taxon.Taxon, eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator, eu.etaxonomy.cdm.model.taxon.Classification)
+ */
+ @Override
+ public UUID deleteTaxon(Taxon arg0, TaxonDeletionConfigurator arg1, Classification arg2)
+ throws DataChangeNoRollbackException {
+ return defaultTaxonService.deleteTaxon(arg0, arg1, arg2);
+ }
+
++ /* (non-Javadoc)
++ * @see eu.etaxonomy.cdm.api.service.ITaxonService#getSynonymsByHomotypicGroup(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.List)
++ */
++ @Override
++ public List<List<Synonym>> getSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths) {
++ return defaultTaxonService.getSynonymsByHomotypicGroup(taxon, propertyPaths);
++ }
++
+
+
+}
*/\r
package eu.etaxonomy.taxeditor.editor.definedterm;\r
\r
--import java.util.HashSet;\r
--import java.util.List;\r
--import java.util.Set;\r
--\r
import org.eclipse.core.runtime.IProgressMonitor;\r
import org.eclipse.jface.action.GroupMarker;\r
import org.eclipse.jface.action.MenuManager;\r
\r
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;\r
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;\r
--import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
import eu.etaxonomy.cdm.model.common.CdmBase;\r
--import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
--import eu.etaxonomy.cdm.model.common.TermType;\r
--import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;\r
--import eu.etaxonomy.taxeditor.editor.definedterm.input.AbstractDefinedTermEditorInput;\r
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import org.eclipse.jface.viewers.ITreeContentProvider;\r
import org.eclipse.jface.viewers.Viewer;\r
\r
--import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
--import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
\r
*/\r
package eu.etaxonomy.taxeditor.editor.definedterm;\r
\r
--import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;\r
--import org.eclipse.jface.viewers.StyledString.Styler;\r
--import org.eclipse.jface.viewers.LabelProvider;\r
import org.eclipse.jface.viewers.StyledCellLabelProvider;\r
import org.eclipse.jface.viewers.StyledString;\r
++import org.eclipse.jface.viewers.StyledString.Styler;\r
import org.eclipse.jface.viewers.ViewerCell;\r
import org.eclipse.swt.SWT;\r
import org.eclipse.swt.custom.StyleRange;\r
import org.eclipse.swt.graphics.TextStyle;\r
import org.eclipse.swt.widgets.Display;\r
\r
--import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
--import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;\r
\r
/**\r
* @author l.morris\r
import org.eclipse.jface.viewers.IStructuredSelection;\r
import org.eclipse.ui.handlers.HandlerUtil;\r
\r
--import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
--import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateDefinedTermOperation;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import org.eclipse.core.commands.IHandler;\r
import org.eclipse.core.commands.common.NotDefinedException;\r
import org.eclipse.core.commands.operations.IUndoContext;\r
--import org.eclipse.jface.viewers.IStructuredSelection;\r
import org.eclipse.ui.handlers.HandlerUtil;\r
\r
--import eu.etaxonomy.cdm.model.common.TermType;\r
--import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.operation.CreateTermVocabularyOperation;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import org.eclipse.jface.viewers.IStructuredSelection;\r
import org.eclipse.ui.handlers.HandlerUtil;\r
\r
--import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
--import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
--import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.operation.DeleteTermBaseOperation;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
*/\r
package eu.etaxonomy.taxeditor.editor.definedterm.operation;\r
\r
--import java.net.URI;\r
--\r
import org.eclipse.core.commands.ExecutionException;\r
import org.eclipse.core.commands.operations.IUndoContext;\r
import org.eclipse.core.runtime.IAdaptable;\r
import org.eclipse.core.runtime.IStatus;\r
\r
import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
--import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
--import eu.etaxonomy.cdm.model.common.OrderedTermVocabulary;\r
--import eu.etaxonomy.cdm.model.common.TermType;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
--import eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermEditor;\r
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
\r
import eu.etaxonomy.cdm.api.service.ITermService;\r
import eu.etaxonomy.cdm.api.service.IVocabularyService;\r
--import eu.etaxonomy.cdm.model.common.DefinedTerm;\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
import eu.etaxonomy.cdm.model.common.TermBase;\r
import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
--import eu.etaxonomy.cdm.model.description.DescriptionBase;\r
--import eu.etaxonomy.cdm.model.description.DescriptionElementBase;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import eu.etaxonomy.taxeditor.store.StoreUtil;\r
import java.io.File;
import java.net.URI;
--import java.net.URISyntaxException;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IWorkbench;
import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
import eu.etaxonomy.taxeditor.store.CdmStore;
--import eu.etaxonomy.taxeditor.store.StoreUtil;
/**
* <p>JaxbExportWizard class.</p>
import org.eclipse.core.runtime.Status;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.common.ITreeNode;
+ import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
package eu.etaxonomy.taxeditor.preference;
--import eu.etaxonomy.cdm.model.common.IDefinedTerm;
+ import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
/**
* <p>IPreferenceKeys interface.</p>
package eu.etaxonomy.taxeditor.store;
--import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
--import eu.etaxonomy.cdm.persistence.hibernate.permission.Operation;
import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
import eu.etaxonomy.taxeditor.io.ExportManager;
import eu.etaxonomy.taxeditor.io.ImportManager;
import java.util.Observable;
import org.eclipse.core.runtime.IProgressMonitor;
--import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IMemento;
--import org.eclipse.ui.IWorkbenchPage;
--import org.eclipse.ui.IWorkbenchPart;
--import org.eclipse.ui.IWorkbenchWindow;
--import org.eclipse.ui.editors.text.EditorsUI;
--import org.eclipse.ui.handlers.HandlerUtil;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.LockedException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
import eu.etaxonomy.cdm.model.reference.ReferenceType;
+ import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.AbstractCdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
AbstractNewEntityWizard wizard = getNewEntityWizard(e.text);
wizard.init(null, null);
- WizardDialog dialog = new WizardDialog(getShell(), wizard);
- int status = dialog.open();
-
- if (status == IStatus.OK) {
+ if(wizard.getEntity() != null) {
+ WizardDialog dialog = new WizardDialog(getShell(), wizard);
+ int status = dialog.open();
- T entity = (T) wizard.getEntity();
+ if (status == IStatus.OK) {
-// addObjectToModel(teamOrPerson);
- refresh();
- setPattern(entity);
- getConversationHolder().bind();
+ T entity = (T) wizard.getEntity();
+ refresh();
+ setPattern(entity);
+ getConversationHolder().bind();
+ }
+ //FIXME : Need to make sure this is a stable fix (ticket 3822)
+ getConversationHolder().commit();
}
}
};
return element;
}
- /**
- * <p>
- * createEnumComboElement
- * </p>
- *
- * @param enumComboType
- * a
- * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
- * object.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
- * object.
- */
+ /**
+ * <p>
+ * createEnumComboElement
+ * </p>
+ *
+ * @param enumComboType
+ * a
+ * {@link eu.eu.etaxonomy.taxeditor.ui.element.CdmFormFactory.EnumComboType}
+ * object.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.term.AbstractEnumComboElement}
+ * object.
+ */
- public <T extends IEnumTerm> EnumComboElement<T> createEnumComboElement(
+ public <T extends IEnumTerm<T>> EnumComboElement<T> createEnumComboElement(
Class<T> enumComboType, ICdmFormElement parentElement,
int style) {
- EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ EnumComboElement<T> element = new EnumComboElement<T>(this, parentElement, enumComboType, style);
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createBrowserElement
- * </p>
- *
- * @param imageUri
- * a {@link java.net.URI} object.
- * @param style
- * a int.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
+ /**
+ * <p>
+ * createBrowserElement
+ * </p>
+ *
+ * @param imageUri
+ * a {@link java.net.URI} object.
+ * @param style
+ * a int.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
* @return a {@link eu.etaxonomy.taxeditor.ui.element.BrowserElement}
* object.
- */
+ */
public BrowserElement createBrowserElement(ICdmFormElement parentElement, URI imageUri, int style) {
BrowserElement element = new BrowserElement(this, parentElement, imageUri, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createImageElement
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param imageUri
- * a {@link java.net.URI} object.
- * @param style
- * a int.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
- */
+ /**
+ * <p>
+ * createImageElement
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param imageUri
+ * a {@link java.net.URI} object.
+ * @param style
+ * a int.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.ImageElement} object.
+ */
public ImageElement createImageElement(ICdmFormElement parentElement, URI imageUri, int style) {
ImageElement element = new ImageElement(this, parentElement, imageUri, style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createTextActionElement
- * </p>
- *
- * @param labelString
- * a {@link java.lang.String} object.
- * @param initialText
- * a {@link java.lang.String} object.
- * @param style
- * a int.
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param buttonLabel
- * a {@link java.lang.String} object.
- * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
- * object.
- */
+ /**
+ * <p>
+ * createTextActionElement
+ * </p>
+ *
+ * @param labelString
+ * a {@link java.lang.String} object.
+ * @param initialText
+ * a {@link java.lang.String} object.
+ * @param style
+ * a int.
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param buttonLabel
+ * a {@link java.lang.String} object.
+ * @return a {@link eu.etaxonomy.taxeditor.ui.element.TextActionElement}
+ * object.
+ */
public TextActionElement createTextActionElement(ICdmFormElement parentElement, String labelString,
- String buttonLabel, String initialText, int style) {
+ String buttonLabel, String initialText, int style) {
TextActionElement element = new TextActionElement(this, parentElement, labelString, buttonLabel, initialText,
style);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * <p>
- * createCheckbox
- * </p>
- *
- * @param parentElement
- * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
- * object.
- * @param label
- * a {@link java.lang.String} object.
- * @param initialState
- * a boolean.
- * @param style
- * a int.
+ /**
+ * <p>
+ * createCheckbox
+ * </p>
+ *
+ * @param parentElement
+ * a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement}
+ * object.
+ * @param label
+ * a {@link java.lang.String} object.
+ * @param initialState
+ * a boolean.
+ * @param style
+ * a int.
* @return a {@link eu.etaxonomy.taxeditor.ui.element.CheckboxElement}
* object.
- */
+ */
public CheckboxElement createCheckbox(ICdmFormElement parentElement, String label, boolean initialState, int style) {
CheckboxElement element = new CheckboxElement(this, parentElement, label, initialState, style | orientation);
- adapt(element);
- parentElement.addElement(element);
- return element;
- }
+ adapt(element);
+ parentElement.addElement(element);
+ return element;
+ }
- /**
- * Creates a section as a part of the form.
- *
- * @return the section widget
- * @param section
+ /**
+ * Creates a section as a part of the form.
+ *
+ * @return the section widget
+ * @param section
* a
* {@link eu.etaxonomy.taxeditor.ui.element.AbstractFormSection}
- * object.
- */
- public Section adapt(AbstractFormSection section) {
- section.setMenu(section.getLayoutComposite().getMenu());
- adapt(section, true, true);
+ * object.
+ */
+ public Section adapt(AbstractFormSection section) {
+ section.setMenu(section.getLayoutComposite().getMenu());
+ adapt(section, true, true);
- // handle focus and property change events for cdm use
- section.addFocusListener(selectionFocusHandler);
- section.setPropertyChangeListeners(propertyChangeListeners);
+ // handle focus and property change events for cdm use
+ section.addFocusListener(selectionFocusHandler);
+ section.setPropertyChangeListeners(propertyChangeListeners);
- if (section.getToggle() != null) {
+ if (section.getToggle() != null) {
section.getToggle().setHoverDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE_HOVER));
section.getToggle().setDecorationColor(getColors().getColor(IFormColors.TB_TOGGLE));
- }
+ }
section.setFont(boldFontHolder2.getBoldFont(section.getLayoutComposite().getFont()));
GatheringEventDetailElement element = new GatheringEventDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
- }
+ }
- public FieldObservationDetailElement createFieldObservationDetailElement(ICdmFormElement parentElement) {
- FieldObservationDetailElement element = new FieldObservationDetailElement(this, parentElement);
+ public FieldUnitDetailElement createFieldUnitDetailElement(ICdmFormElement parentElement) {
+ FieldUnitDetailElement element = new FieldUnitDetailElement(this, parentElement);
addAndAdaptElement(parentElement, element);
return element;
- }
+ }
+
public DerivedUnitBaseDetailElement createDerivedUnitBaseDetailElement(ICdmFormElement parentElement) {
DerivedUnitBaseDetailElement element = new DerivedUnitBaseDetailElement(this, parentElement);
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.widgets.Display;
- import eu.etaxonomy.cdm.common.CdmUtils;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
-
/**
* <p>NumberWithLabelElement class.</p>
*
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
+ import eu.etaxonomy.taxeditor.model.ImageResources;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
/**
* When the button is pressed, this textfield may be edited.
*/
package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
--import org.eclipse.swt.widgets.Composite;
--import org.eclipse.swt.widgets.Button;
--import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.SWT;
++import org.eclipse.swt.events.MouseAdapter;
++import org.eclipse.swt.events.MouseEvent;
++import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.layout.RowLayout;
++import org.eclipse.swt.widgets.Button;
++import org.eclipse.swt.widgets.Composite;
++import org.eclipse.swt.widgets.Display;
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
import eu.etaxonomy.cdm.persistence.hibernate.permission.Operation;
--import org.eclipse.swt.events.MouseAdapter;
--import org.eclipse.swt.events.MouseEvent;
--import org.eclipse.swt.events.MouseTrackAdapter;
--
/**
* Widget for editing {@link Operation} objects, consisting of 4 checkboxes for CREATE, UPDATE, READ, DELETE operations.
import org.eclipse.nebula.widgets.compositetable.CompositeTable;
import org.eclipse.nebula.widgets.compositetable.IRowContentProvider;
--
++import org.eclipse.swt.SWT;
++import org.eclipse.swt.dnd.DND;
++import org.eclipse.swt.dnd.DropTarget;
++import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
++import org.eclipse.swt.layout.GridData;
++import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
++import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
++import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.widgets.FormToolkit;
--import org.eclipse.swt.SWT;
--import org.eclipse.swt.widgets.Control;
import eu.etaxonomy.taxeditor.dnd.CdmAuthorityTableDropTargetListener;
import eu.etaxonomy.taxeditor.dnd.transfer.TaxonNodeTransfer;
--import org.eclipse.swt.dnd.DropTarget;
--import org.eclipse.swt.dnd.DND;
--import org.eclipse.swt.dnd.Transfer;
--import org.eclipse.swt.layout.GridLayout;
--import org.eclipse.swt.widgets.Label;
--import org.eclipse.swt.layout.GridData;
--
/**
* Composite class which consists of a {@link CompositeTable} built specifically
* for creating / editing CDM Authority objects
import org.springframework.security.core.GrantedAuthority;
import eu.etaxonomy.cdm.model.common.CdmBase;
--import eu.etaxonomy.cdm.model.common.Group;
--import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
--import eu.etaxonomy.taxeditor.store.StoreUtil;
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
++import eu.etaxonomy.cdm.model.common.Group;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CRUD;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
++import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
++import eu.etaxonomy.taxeditor.store.StoreUtil;
*/
package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
++import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
++import org.eclipse.swt.events.MouseAdapter;
++import org.eclipse.swt.events.MouseEvent;
++import org.eclipse.swt.layout.GridData;
++import org.eclipse.swt.layout.GridLayout;
++import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
--import org.eclipse.ui.forms.widgets.FormToolkit;
--import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Label;
--import org.eclipse.swt.SWT;
--
--import org.eclipse.swt.widgets.Button;
--import org.eclipse.swt.layout.GridData;
++import org.eclipse.ui.forms.widgets.FormToolkit;
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
import eu.etaxonomy.cdm.persistence.hibernate.permission.CdmAuthority;
import eu.etaxonomy.taxeditor.model.ImageResources;
--import org.eclipse.swt.events.MouseAdapter;
--import org.eclipse.swt.events.MouseEvent;
--
/**
* Row widget for editing a single CDM Authority
*/
package eu.etaxonomy.taxeditor.ui.group.grantedauthority;
++import org.eclipse.swt.SWT;
++import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
++import org.eclipse.swt.layout.GridData;
++import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
--import org.eclipse.ui.forms.widgets.FormToolkit;
--import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Label;
--import org.eclipse.swt.SWT;
--import org.eclipse.swt.layout.GridData;
--import org.eclipse.swt.custom.CLabel;
++import org.eclipse.ui.forms.widgets.FormToolkit;
/**
* Table header widget for {@link CdmAuthorityComposite}
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.api.facade.MethodNotSupportedByDerivedUnitTypeException;
+ import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
+ import eu.etaxonomy.cdm.model.occurrence.PreservationMethod;
import eu.etaxonomy.taxeditor.model.AbstractUtility;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+ import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
+ import eu.etaxonomy.cdm.model.common.TermType;
import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
--- /dev/null
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+ // $Id$
+ /**
+ * Copyright (C) 2013 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.ui.section.occurrence;
+
+ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
+ import eu.etaxonomy.cdm.model.agent.AgentBase;
+ import eu.etaxonomy.cdm.model.common.LanguageString;
+ import eu.etaxonomy.cdm.model.location.NamedArea;
+ import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
++import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+ import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
+ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+ import eu.etaxonomy.taxeditor.ui.element.LanguageStringWithLabelElement;
+ import eu.etaxonomy.taxeditor.ui.element.NumberWithLabelElement;
+ import eu.etaxonomy.taxeditor.ui.element.PointElement;
+ import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
+ import eu.etaxonomy.taxeditor.ui.element.TimePeriodElement;
+ import eu.etaxonomy.taxeditor.ui.element.ToggleableTextElement;
+ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+ import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
+
+ /**
+ * @author pplitzner
+ * @date 05.11.2013
+ *
+ */
+ public class FieldUnitGeneralDetailElement extends AbstractCdmDetailElement<DerivedUnitFacade> {
+
+ private ToggleableTextElement toggleableText_titleCache;
+ private EnumComboElement<SpecimenOrObservationType> combo_specorobstype;
+ private EntitySelectionElement<NamedArea> selection_country;
+ private LanguageStringWithLabelElement languageText_locality;
+ private PointElement element_point;
+ private NumberWithLabelElement number_elevation;
+ private TimePeriodElement element_date;
+ private EntitySelectionElement<AgentBase> selection_collector;
+ private TextWithLabelElement text_collectingNumber;
+
+ /**
+ * @param formFactory
+ * @param formElement
+ */
+ public FieldUnitGeneralDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
+ super(formFactory, formElement);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
+ * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
+ */
+ @Override
+ protected void createControls(ICdmFormElement formElement, DerivedUnitFacade entity, int style) {
+ toggleableText_titleCache = formFactory.createToggleableTextField(formElement, "Title Cache",
+ entity.getTitleCache(), entity.isProtectedTitleCache(), style);
+ combo_specorobstype = formFactory.createEnumComboElement(SpecimenOrObservationType.class, formElement, style);
+ combo_specorobstype.setSelection(entity.getType());
+ selection_country = formFactory.createSelectionElement(NamedArea.class, getConversationHolder(), formElement,
+ "Country", entity.getCountry(), EntitySelectionElement.NOTHING, style);
+ languageText_locality = formFactory.createLanguageStringWithLabelElement(formElement, "Locality",
+ entity.getLocality(), style);
+ element_point = formFactory.createPointElement(formElement, entity.getExactLocation(), style);
+ element_date = formFactory.createTimePeriodElement(formElement, "Date", entity.getGatheringPeriod(), style);
+ selection_collector = formFactory.createSelectionElement(AgentBase.class, getConversationHolder(), formElement,
+ "Collector", entity.getCollector(), EntitySelectionElement.ALL, style);
+ text_collectingNumber = formFactory.createTextWithLabelElement(formElement, "Collecting number",
+ entity.getFieldNumber(), style);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
+ * .lang.Object)
+ */
+ @Override
+ public void handleEvent(Object eventSource) {
+ if (eventSource == toggleableText_titleCache) {
+ getEntity().setTitleCache(toggleableText_titleCache.getText(), toggleableText_titleCache.getState());
+ } else if (eventSource == selection_country) {
+ getEntity().setCountry(selection_country.getSelection());
+ } else if (eventSource == languageText_locality) {
+ LanguageString locality = languageText_locality.getLanguageString();
+ getEntity().setLocality(locality);
+ } else if (eventSource == element_point) {
+ getEntity().setExactLocation(element_point.getPoint());
+ } else if (eventSource == number_elevation) {
+ getEntity().setAbsoluteElevation(number_elevation.getInteger());
+ } else if (eventSource == element_date) {
+ getEntity().setGatheringPeriod(element_date.getTimePeriod());
+ } else if (eventSource == selection_collector) {
+ getEntity().setCollector(selection_collector.getSelection());
+ } else if (eventSource == text_collectingNumber) {
+ getEntity().setFieldNumber(text_collectingNumber.getText());
+ } else if (eventSource == combo_specorobstype) {
+ getEntity().setType(combo_specorobstype.getSelection());
+ }
+
+ if (eventSource != toggleableText_titleCache) {
+ toggleableText_titleCache.setText(getEntity().getTitleCache());
+ }
+ }
+ }
--- /dev/null
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+ // $Id$
+ /**
+ * Copyright (C) 2013 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.ui.section.occurrence;
+
+ import org.eclipse.jface.viewers.ISelectionProvider;
+
+ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
++import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
+
+ /**
+ * @author pplitzner
+ * @date 05.11.2013
+ *
+ */
+ public class FieldUnitGeneralDetailSection extends AbstractCdmDetailSection<DerivedUnitFacade> implements IDerivedUnitFacadeDetailSection{
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param parentElement
+ * @param selectionProvider
+ * @param style
+ */
+ public FieldUnitGeneralDetailSection(CdmFormFactory formFactory,
+ ConversationHolder conversation, ICdmFormElement parentElement,
+ ISelectionProvider selectionProvider, int style) {
+ super(formFactory, conversation, parentElement, selectionProvider, style);
+ }
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.section.AbstractCdmDetailSection#getHeading()
+ */
+ @Override
+ public String getHeading() {
+ return "General";
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection#createCdmDetailElement(eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection, int)
+ */
+ @Override
+ protected AbstractCdmDetailElement<DerivedUnitFacade> createCdmDetailElement(AbstractCdmDetailSection<DerivedUnitFacade> parentElement, int style) {
+ return formFactory.createFieldUnitGeneralDetailElement(parentElement);
+ }
+
+ }
--- /dev/null
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+ // $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.ui.section.occurrence;
+
+ import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+ import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
++import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
+ import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
+ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+ import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+
+ /**
+ * @author n.hoffmann
+ * @created Dec 15, 2010
+ * @version 1.0
+ */
+ public class FieldUnitWizardPage extends AbstractCdmEntityWizardPage<DerivedUnitFacade> {
+
+ /**
+ * @param formFactory
+ * @param conversation
+ * @param entity
+ */
+ public FieldUnitWizardPage(CdmFormFactory formFactory,
+ ConversationHolder conversation, DerivedUnitFacade entity) {
+ super(formFactory, conversation, entity);
+ setTitle("Field Unit Details");
+ setPageComplete(true);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.ui.forms.AbstractCdmEntityWizardPage#checkComplete()
+ */
+ @Override
+ protected void checkComplete() {
+ setPageComplete(true);
+ }
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.forms.AbstractCdmEntityWizardPage#createElement(eu.etaxonomy.taxeditor.forms.ICdmFormElement)
+ */
+ @Override
+ public AbstractCdmDetailElement<DerivedUnitFacade> createElement(ICdmFormElement rootElement) {
+ FieldUnitDetailElement detailElement = formFactory.createFieldUnitDetailElement(rootElement);
+ detailElement.setEntity(getEntity());
+ return detailElement;
+ }
+
+ }
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.AbstractUtility;
import eu.etaxonomy.taxeditor.model.AuthorHelper;
- import eu.etaxonomy.taxeditor.store.StoreUtil;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.combo.EnumComboElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
import eu.etaxonomy.taxeditor.ui.element.CdmPropertyChangeEvent;
import eu.etaxonomy.cdm.model.name.NonViralName;
import eu.etaxonomy.cdm.model.reference.Reference;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
- import eu.etaxonomy.taxeditor.store.StoreUtil;
+ import eu.etaxonomy.taxeditor.model.AbstractUtility;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailSection;
import eu.etaxonomy.taxeditor.ui.section.ITaxonBaseDetailSection;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
+ import eu.etaxonomy.cdm.model.common.OriginalSourceType;
+ import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
- import eu.etaxonomy.cdm.model.common.OriginalSourceType;
-
- import eu.etaxonomy.taxeditor.ui.dialog.selection.OriginalSourceTypeSelectionDialog;;
/**
* <p>SourceSection class.</p>
}\r
}\r
List<DefinedTerm> emptyListToResetComboBox = new ArrayList<DefinedTerm>();\r
- //FIXME:3.3MC----\r
- //DefinedTerm emptyMod = DefinedTerm.NewInstance();\r
+ \r
+ // DefinedTerm emptyMod = DefinedTerm.NewInstance();\r
DefinedTerm emptyMod = null;\r
- //FIXME:3.3MC----\r
- \r
- \r
+\r
+\r
emptyListToResetComboBox.add(emptyMod);\r
combo_EthnicGroup.setTerms(emptyListToResetComboBox);\r
combo_EthnicGroup.setEnabled(false);\r
--- /dev/null
-import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;\r
+ // $Id$\r
+ /**\r
+ * Copyright (C) 2009 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.ui.section.vocabulary;\r
+ \r
+ import eu.etaxonomy.cdm.model.description.Feature;\r
++import eu.etaxonomy.taxeditor.ui.campanula.compatibility.ICdmFormElement;\r
+ import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;\r
+ import eu.etaxonomy.taxeditor.ui.element.CheckboxElement;\r
+ \r
+ /**\r
+ * @author l.morris\r
+ * @date 20 Dec 2011\r
+ *\r
+ */\r
+ public class FeatureDetailElement extends DefinedTermDetailElement<Feature> {\r
+ \r
+ private CheckboxElement supportsTextData;\r
+ \r
+ private CheckboxElement supportsQuantitativeData;\r
+ \r
+ private CheckboxElement supportsDistribution;\r
+ \r
+ private CheckboxElement supportsIndividualAssociation;\r
+ \r
+ private CheckboxElement supportsTaxonInteraction;\r
+ \r
+ private CheckboxElement supportsCategoricalData;\r
+ \r
+ private CheckboxElement supportsCommonTaxonName;\r
+ \r
+ /**\r
+ * @param formFactory\r
+ * @param formElement\r
+ */\r
+ public FeatureDetailElement(CdmFormFactory formFactory,\r
+ ICdmFormElement formElement) {\r
+ super(formFactory, formElement);\r
+ }\r
+ \r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.AbstractTermBaseDetailElement#createControls(eu.etaxonomy.taxeditor.ui.element.ICdmFormElement, eu.etaxonomy.cdm.model.common.TermBase, int)\r
+ */\r
+ @Override\r
+ protected void createControls(ICdmFormElement formElement, Feature entity, int style) {\r
+ super.createControls(formElement, entity, style);\r
+ supportsTextData = formFactory.createCheckbox(formElement, "Supports Text Data", entity.isSupportsTextData(), style);\r
+ supportsQuantitativeData = formFactory.createCheckbox(formElement, "Supports Quantitive Data", entity.isSupportsQuantitativeData(), style);\r
+ supportsDistribution = formFactory.createCheckbox(formElement, "Supports Distribution", entity.isSupportsDistribution(), style);\r
+ supportsIndividualAssociation = formFactory.createCheckbox(formElement, "Supports Individual Association", entity.isSupportsIndividualAssociation(), style);\r
+ supportsTaxonInteraction = formFactory.createCheckbox(formElement, "Supports Taxon Interaction", entity.isSupportsTaxonInteraction(), style);\r
+ supportsCategoricalData = formFactory.createCheckbox(formElement, "Supports Categorical Data", entity.isSupportsCategoricalData(), style);\r
+ supportsCommonTaxonName = formFactory.createCheckbox(formElement, "Supports Common Taxon Name", entity.isSupportsCommonTaxonName(), style);\r
+ }\r
+ \r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.taxeditor.ui.section.vocabulary.DefinedTermDetailElement#handleEvent(java.lang.Object)\r
+ */\r
+ @Override\r
+ public void handleEvent(Object eventSource) {\r
+ super.handleEvent(eventSource);\r
+ if(eventSource == supportsTextData){\r
+ getEntity().setSupportsTextData(supportsTextData.getSelection());\r
+ }\r
+ else if(eventSource == supportsQuantitativeData){\r
+ getEntity().setSupportsQuantitativeData(supportsQuantitativeData.getSelection());\r
+ }\r
+ else if(eventSource == supportsDistribution){\r
+ getEntity().setSupportsDistribution(supportsDistribution.getSelection());\r
+ }\r
+ else if(eventSource == supportsIndividualAssociation){\r
+ getEntity().setSupportsIndividualAssociation(supportsIndividualAssociation.getSelection());\r
+ }\r
+ else if(eventSource == supportsTaxonInteraction){\r
+ getEntity().setSupportsTaxonInteraction(supportsTaxonInteraction.getSelection());\r
+ }\r
+ else if(eventSource == supportsCategoricalData){\r
+ getEntity().setSupportsCategoricalData(supportsCategoricalData.getSelection());\r
+ }\r
+ else if(eventSource == supportsCommonTaxonName){\r
+ getEntity().setSupportsCommonTaxonName(supportsCommonTaxonName.getSelection());\r
+ }\r
+ }\r
+ \r
+ }\r
--- /dev/null
- import java.io.File;
- import java.io.InputStream;
- import java.lang.reflect.Constructor;
- import java.lang.reflect.Method;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.Map;
-
- import org.eclipse.core.runtime.Platform;
- import org.eclipse.jface.resource.CompositeImageDescriptor;
- import org.eclipse.jface.resource.ImageDescriptor;
- import org.eclipse.swt.graphics.Image;
- import org.eclipse.swt.graphics.Point;
- import org.eclipse.swt.graphics.Rectangle;
- import org.osgi.framework.Bundle;
+/*******************************************************************************\r
+ * Copyright (c) 2011 Google, Inc.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Google, Inc. - initial API and implementation\r
+ *******************************************************************************/\r
+package org.eclipse.wb.swt;
+
++import java.io.File;\r
++import java.io.InputStream;\r
++import java.lang.reflect.Constructor;\r
++import java.lang.reflect.Method;\r
++import java.net.MalformedURLException;\r
++import java.net.URL;\r
++import java.util.HashMap;\r
++import java.util.Iterator;\r
++import java.util.Map;\r
++\r
++import org.eclipse.core.runtime.Platform;\r
++import org.eclipse.jface.resource.CompositeImageDescriptor;\r
++import org.eclipse.jface.resource.ImageDescriptor;\r
++import org.eclipse.swt.graphics.Image;\r
++import org.eclipse.swt.graphics.Point;\r
++import org.eclipse.swt.graphics.Rectangle;\r
++import org.osgi.framework.Bundle;\r
+
+/**
+ * Utility class for managing OS resources associated with SWT/JFace controls such as colors, fonts, images,
+ * etc.
+ *
+ * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the
+ * operating system resources managed by cached objects when those objects and OS resources are no longer
+ * needed (e.g. on application shutdown)
+ *
+ * This class may be freely distributed as part of any application or plugin.
+ * <p>
+ *
+ * @author scheglov_ke
+ * @author Dan Rubel
+ */
+public class ResourceManager extends SWTResourceManager {
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Image
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ private static Map<ImageDescriptor, Image> m_descriptorImageMap = new HashMap<ImageDescriptor, Image>();
+ /**
+ * Returns an {@link ImageDescriptor} stored in the file at the specified path relative to the specified
+ * class.
+ *
+ * @param clazz
+ * the {@link Class} relative to which to find the image descriptor.
+ * @param path
+ * the path to the image file.
+ * @return the {@link ImageDescriptor} stored in the file at the specified path.
+ */
+ public static ImageDescriptor getImageDescriptor(Class<?> clazz, String path) {
+ return ImageDescriptor.createFromFile(clazz, path);
+ }
+ /**
+ * Returns an {@link ImageDescriptor} stored in the file at the specified path.
+ *
+ * @param path
+ * the path to the image file.
+ * @return the {@link ImageDescriptor} stored in the file at the specified path.
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ try {
+ return ImageDescriptor.createFromURL(new File(path).toURI().toURL());
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+ /**
+ * Returns an {@link Image} based on the specified {@link ImageDescriptor}.
+ *
+ * @param descriptor
+ * the {@link ImageDescriptor} for the {@link Image}.
+ * @return the {@link Image} based on the specified {@link ImageDescriptor}.
+ */
+ public static Image getImage(ImageDescriptor descriptor) {
+ if (descriptor == null) {
+ return null;
+ }
+ Image image = m_descriptorImageMap.get(descriptor);
+ if (image == null) {
+ image = descriptor.createImage();
+ m_descriptorImageMap.put(descriptor, image);
+ }
+ return image;
+ }
+ /**
+ * Maps images to decorated images.
+ */
+ @SuppressWarnings("unchecked")
+ private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated.
+ * @param decorator
+ * the {@link Image} to decorate the base image.
+ * @return {@link Image} The resulting decorated image.
+ */
+ public static Image decorateImage(Image baseImage, Image decorator) {
+ return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
+ }
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated.
+ * @param decorator
+ * the {@link Image} to decorate the base image.
+ * @param corner
+ * the corner to place decorator image.
+ * @return the resulting decorated {@link Image}.
+ */
+ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
+ if (corner <= 0 || corner >= LAST_CORNER_KEY) {
+ throw new IllegalArgumentException("Wrong decorate corner");
+ }
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner];
+ if (cornerDecoratedImageMap == null) {
+ cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>();
+ m_decoratedImageMap[corner] = cornerDecoratedImageMap;
+ }
+ Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage);
+ if (decoratedMap == null) {
+ decoratedMap = new HashMap<Image, Image>();
+ cornerDecoratedImageMap.put(baseImage, decoratedMap);
+ }
+ //
+ Image result = decoratedMap.get(decorator);
+ if (result == null) {
+ final Rectangle bib = baseImage.getBounds();
+ final Rectangle dib = decorator.getBounds();
+ final Point baseImageSize = new Point(bib.width, bib.height);
+ CompositeImageDescriptor compositImageDesc = new CompositeImageDescriptor() {
+ @Override
+ protected void drawCompositeImage(int width, int height) {
+ drawImage(baseImage.getImageData(), 0, 0);
+ if (corner == TOP_LEFT) {
+ drawImage(decorator.getImageData(), 0, 0);
+ } else if (corner == TOP_RIGHT) {
+ drawImage(decorator.getImageData(), bib.width - dib.width, 0);
+ } else if (corner == BOTTOM_LEFT) {
+ drawImage(decorator.getImageData(), 0, bib.height - dib.height);
+ } else if (corner == BOTTOM_RIGHT) {
+ drawImage(decorator.getImageData(), bib.width - dib.width, bib.height - dib.height);
+ }
+ }
+ @Override
+ protected Point getSize() {
+ return baseImageSize;
+ }
+ };
+ //
+ result = compositImageDesc.createImage();
+ decoratedMap.put(decorator, result);
+ }
+ return result;
+ }
+ /**
+ * Dispose all of the cached images.
+ */
+ public static void disposeImages() {
+ SWTResourceManager.disposeImages();
+ // dispose ImageDescriptor images
+ {
+ for (Iterator<Image> I = m_descriptorImageMap.values().iterator(); I.hasNext();) {
+ I.next().dispose();
+ }
+ m_descriptorImageMap.clear();
+ }
+ // dispose decorated images
+ for (int i = 0; i < m_decoratedImageMap.length; i++) {
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i];
+ if (cornerDecoratedImageMap != null) {
+ for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) {
+ for (Image image : decoratedMap.values()) {
+ image.dispose();
+ }
+ decoratedMap.clear();
+ }
+ cornerDecoratedImageMap.clear();
+ }
+ }
+ // dispose plugin images
+ {
+ for (Iterator<Image> I = m_URLImageMap.values().iterator(); I.hasNext();) {
+ I.next().dispose();
+ }
+ m_URLImageMap.clear();
+ }
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Plugin images support
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps URL to images.
+ */
+ private static Map<String, Image> m_URLImageMap = new HashMap<String, Image>();
+ /**
+ * Provider for plugin resources, used by WindowBuilder at design time.
+ */
+ public interface PluginResourceProvider {
+ URL getEntry(String symbolicName, String path);
+ }
+ /**
+ * Instance of {@link PluginResourceProvider}, used by WindowBuilder at design time.
+ */
+ private static PluginResourceProvider m_designTimePluginResourceProvider = null;
+ /**
+ * Returns an {@link Image} based on a plugin and file path.
+ *
+ * @param plugin
+ * the plugin {@link Object} containing the image
+ * @param name
+ * the path to the image within the plugin
+ * @return the {@link Image} stored in the file at the specified path
+ *
+ * @deprecated Use {@link #getPluginImage(String, String)} instead.
+ */
+ @Deprecated
+ public static Image getPluginImage(Object plugin, String name) {
+ try {
+ URL url = getPluginImageURL(plugin, name);
+ if (url != null) {
+ return getPluginImageFromUrl(url);
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link Image} based on a {@link Bundle} and resource entry path.
+ *
+ * @param symbolicName
+ * the symbolic name of the {@link Bundle}.
+ * @param path
+ * the path of the resource entry.
+ * @return the {@link Image} stored in the file at the specified path.
+ */
+ public static Image getPluginImage(String symbolicName, String path) {
+ try {
+ URL url = getPluginImageURL(symbolicName, path);
+ if (url != null) {
+ return getPluginImageFromUrl(url);
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link Image} based on given {@link URL}.
+ */
+ private static Image getPluginImageFromUrl(URL url) {
+ try {
+ try {
+ String key = url.toExternalForm();
+ Image image = m_URLImageMap.get(key);
+ if (image == null) {
+ InputStream stream = url.openStream();
+ try {
+ image = getImage(stream);
+ m_URLImageMap.put(key, image);
+ } finally {
+ stream.close();
+ }
+ }
+ return image;
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link ImageDescriptor} based on a plugin and file path.
+ *
+ * @param plugin
+ * the plugin {@link Object} containing the image.
+ * @param name
+ * the path to th eimage within the plugin.
+ * @return the {@link ImageDescriptor} stored in the file at the specified path.
+ *
+ * @deprecated Use {@link #getPluginImageDescriptor(String, String)} instead.
+ */
+ @Deprecated
+ public static ImageDescriptor getPluginImageDescriptor(Object plugin, String name) {
+ try {
+ try {
+ URL url = getPluginImageURL(plugin, name);
+ return ImageDescriptor.createFromURL(url);
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link ImageDescriptor} based on a {@link Bundle} and resource entry path.
+ *
+ * @param symbolicName
+ * the symbolic name of the {@link Bundle}.
+ * @param path
+ * the path of the resource entry.
+ * @return the {@link ImageDescriptor} based on a {@link Bundle} and resource entry path.
+ */
+ public static ImageDescriptor getPluginImageDescriptor(String symbolicName, String path) {
+ try {
+ URL url = getPluginImageURL(symbolicName, path);
+ if (url != null) {
+ return ImageDescriptor.createFromURL(url);
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ return null;
+ }
+ /**
+ * Returns an {@link URL} based on a {@link Bundle} and resource entry path.
+ */
+ private static URL getPluginImageURL(String symbolicName, String path) {
+ // try runtime plugins
+ {
+ Bundle bundle = Platform.getBundle(symbolicName);
+ if (bundle != null) {
+ return bundle.getEntry(path);
+ }
+ }
+ // try design time provider
+ if (m_designTimePluginResourceProvider != null) {
+ return m_designTimePluginResourceProvider.getEntry(symbolicName, path);
+ }
+ // no such resource
+ return null;
+ }
+ /**
+ * Returns an {@link URL} based on a plugin and file path.
+ *
+ * @param plugin
+ * the plugin {@link Object} containing the file path.
+ * @param name
+ * the file path.
+ * @return the {@link URL} representing the file at the specified path.
+ * @throws Exception
+ */
+ private static URL getPluginImageURL(Object plugin, String name) throws Exception {
+ // try to work with 'plugin' as with OSGI BundleContext
+ try {
+ Class<?> BundleClass = Class.forName("org.osgi.framework.Bundle"); //$NON-NLS-1$
+ Class<?> BundleContextClass = Class.forName("org.osgi.framework.BundleContext"); //$NON-NLS-1$
+ if (BundleContextClass.isAssignableFrom(plugin.getClass())) {
+ Method getBundleMethod = BundleContextClass.getMethod("getBundle", new Class[0]); //$NON-NLS-1$
+ Object bundle = getBundleMethod.invoke(plugin, new Object[0]);
+ //
+ Class<?> PathClass = Class.forName("org.eclipse.core.runtime.Path"); //$NON-NLS-1$
+ Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class});
+ Object path = pathConstructor.newInstance(new Object[]{name});
+ //
+ Class<?> IPathClass = Class.forName("org.eclipse.core.runtime.IPath"); //$NON-NLS-1$
+ Class<?> PlatformClass = Class.forName("org.eclipse.core.runtime.Platform"); //$NON-NLS-1$
+ Method findMethod = PlatformClass.getMethod("find", new Class[]{BundleClass, IPathClass}); //$NON-NLS-1$
+ return (URL) findMethod.invoke(null, new Object[]{bundle, path});
+ }
+ } catch (Throwable e) {
+ // Ignore any exceptions
+ }
+ // else work with 'plugin' as with usual Eclipse plugin
+ {
+ Class<?> PluginClass = Class.forName("org.eclipse.core.runtime.Plugin"); //$NON-NLS-1$
+ if (PluginClass.isAssignableFrom(plugin.getClass())) {
+ //
+ Class<?> PathClass = Class.forName("org.eclipse.core.runtime.Path"); //$NON-NLS-1$
+ Constructor<?> pathConstructor = PathClass.getConstructor(new Class[]{String.class});
+ Object path = pathConstructor.newInstance(new Object[]{name});
+ //
+ Class<?> IPathClass = Class.forName("org.eclipse.core.runtime.IPath"); //$NON-NLS-1$
+ Method findMethod = PluginClass.getMethod("find", new Class[]{IPathClass}); //$NON-NLS-1$
+ return (URL) findMethod.invoke(plugin, new Object[]{path});
+ }
+ }
+ return null;
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // General
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Dispose of cached objects and their underlying OS resources. This should only be called when the cached
+ * objects are no longer needed (e.g. on application shutdown).
+ */
+ public static void dispose() {
+ disposeColors();
+ disposeFonts();
+ disposeImages();
+ }
+}
--- /dev/null
- import java.io.FileInputStream;
- import java.io.IOException;
- import java.io.InputStream;
- import java.util.HashMap;
- import java.util.Map;
-
- import org.eclipse.swt.SWT;
- import org.eclipse.swt.graphics.Color;
- import org.eclipse.swt.graphics.Cursor;
- import org.eclipse.swt.graphics.Font;
- import org.eclipse.swt.graphics.FontData;
- import org.eclipse.swt.graphics.GC;
- import org.eclipse.swt.graphics.Image;
- import org.eclipse.swt.graphics.ImageData;
- import org.eclipse.swt.graphics.RGB;
- import org.eclipse.swt.graphics.Rectangle;
- import org.eclipse.swt.widgets.Display;
+/*******************************************************************************\r
+ * Copyright (c) 2011 Google, Inc.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ * Google, Inc. - initial API and implementation\r
+ *******************************************************************************/\r
+package org.eclipse.wb.swt;
+
++import java.io.FileInputStream;\r
++import java.io.IOException;\r
++import java.io.InputStream;\r
++import java.util.HashMap;\r
++import java.util.Map;\r
++\r
++import org.eclipse.swt.SWT;\r
++import org.eclipse.swt.graphics.Color;\r
++import org.eclipse.swt.graphics.Cursor;\r
++import org.eclipse.swt.graphics.Font;\r
++import org.eclipse.swt.graphics.FontData;\r
++import org.eclipse.swt.graphics.GC;\r
++import org.eclipse.swt.graphics.Image;\r
++import org.eclipse.swt.graphics.ImageData;\r
++import org.eclipse.swt.graphics.RGB;\r
++import org.eclipse.swt.graphics.Rectangle;\r
++import org.eclipse.swt.widgets.Display;\r
+
+/**
+ * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc.
+ * <p>
+ * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the
+ * operating system resources managed by cached objects when those objects and OS resources are no longer
+ * needed (e.g. on application shutdown)
+ * <p>
+ * This class may be freely distributed as part of any application or plugin.
+ * <p>
+ * @author scheglov_ke
+ * @author Dan Rubel
+ */
+public class SWTResourceManager {
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Color
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ private static Map<RGB, Color> m_colorMap = new HashMap<RGB, Color>();
+ /**
+ * Returns the system {@link Color} matching the specific ID.
+ *
+ * @param systemColorID
+ * the ID value for the color
+ * @return the system {@link Color} matching the specific ID
+ */
+ public static Color getColor(int systemColorID) {
+ Display display = Display.getCurrent();
+ return display.getSystemColor(systemColorID);
+ }
+ /**
+ * Returns a {@link Color} given its red, green and blue component values.
+ *
+ * @param r
+ * the red component of the color
+ * @param g
+ * the green component of the color
+ * @param b
+ * the blue component of the color
+ * @return the {@link Color} matching the given red, green and blue component values
+ */
+ public static Color getColor(int r, int g, int b) {
+ return getColor(new RGB(r, g, b));
+ }
+ /**
+ * Returns a {@link Color} given its RGB value.
+ *
+ * @param rgb
+ * the {@link RGB} value of the color
+ * @return the {@link Color} matching the RGB value
+ */
+ public static Color getColor(RGB rgb) {
+ Color color = m_colorMap.get(rgb);
+ if (color == null) {
+ Display display = Display.getCurrent();
+ color = new Color(display, rgb);
+ m_colorMap.put(rgb, color);
+ }
+ return color;
+ }
+ /**
+ * Dispose of all the cached {@link Color}'s.
+ */
+ public static void disposeColors() {
+ for (Color color : m_colorMap.values()) {
+ color.dispose();
+ }
+ m_colorMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Image
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps image paths to images.
+ */
+ private static Map<String, Image> m_imageMap = new HashMap<String, Image>();
+ /**
+ * Returns an {@link Image} encoded by the specified {@link InputStream}.
+ *
+ * @param stream
+ * the {@link InputStream} encoding the image data
+ * @return the {@link Image} encoded by the specified input stream
+ */
+ protected static Image getImage(InputStream stream) throws IOException {
+ try {
+ Display display = Display.getCurrent();
+ ImageData data = new ImageData(stream);
+ if (data.transparentPixel > 0) {
+ return new Image(display, data, data.getTransparencyMask());
+ }
+ return new Image(display, data);
+ } finally {
+ stream.close();
+ }
+ }
+ /**
+ * Returns an {@link Image} stored in the file at the specified path.
+ *
+ * @param path
+ * the path to the image file
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(String path) {
+ Image image = m_imageMap.get(path);
+ if (image == null) {
+ try {
+ image = getImage(new FileInputStream(path));
+ m_imageMap.put(path, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(path, image);
+ }
+ }
+ return image;
+ }
+ /**
+ * Returns an {@link Image} stored in the file at the specified path relative to the specified class.
+ *
+ * @param clazz
+ * the {@link Class} relative to which to find the image
+ * @param path
+ * the path to the image file, if starts with <code>'/'</code>
+ * @return the {@link Image} stored in the file at the specified path
+ */
+ public static Image getImage(Class<?> clazz, String path) {
+ String key = clazz.getName() + '|' + path;
+ Image image = m_imageMap.get(key);
+ if (image == null) {
+ try {
+ image = getImage(clazz.getResourceAsStream(path));
+ m_imageMap.put(key, image);
+ } catch (Exception e) {
+ image = getMissingImage();
+ m_imageMap.put(key, image);
+ }
+ }
+ return image;
+ }
+ private static final int MISSING_IMAGE_SIZE = 10;
+ /**
+ * @return the small {@link Image} that can be used as placeholder for missing image.
+ */
+ private static Image getMissingImage() {
+ Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ //
+ GC gc = new GC(image);
+ gc.setBackground(getColor(SWT.COLOR_RED));
+ gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE);
+ gc.dispose();
+ //
+ return image;
+ }
+ /**
+ * Style constant for placing decorator image in top left corner of base image.
+ */
+ public static final int TOP_LEFT = 1;
+ /**
+ * Style constant for placing decorator image in top right corner of base image.
+ */
+ public static final int TOP_RIGHT = 2;
+ /**
+ * Style constant for placing decorator image in bottom left corner of base image.
+ */
+ public static final int BOTTOM_LEFT = 3;
+ /**
+ * Style constant for placing decorator image in bottom right corner of base image.
+ */
+ public static final int BOTTOM_RIGHT = 4;
+ /**
+ * Internal value.
+ */
+ protected static final int LAST_CORNER_KEY = 5;
+ /**
+ * Maps images to decorated images.
+ */
+ @SuppressWarnings("unchecked")
+ private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY];
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @return {@link Image} The resulting decorated image
+ */
+ public static Image decorateImage(Image baseImage, Image decorator) {
+ return decorateImage(baseImage, decorator, BOTTOM_RIGHT);
+ }
+ /**
+ * Returns an {@link Image} composed of a base image decorated by another image.
+ *
+ * @param baseImage
+ * the base {@link Image} that should be decorated
+ * @param decorator
+ * the {@link Image} to decorate the base image
+ * @param corner
+ * the corner to place decorator image
+ * @return the resulting decorated {@link Image}
+ */
+ public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) {
+ if (corner <= 0 || corner >= LAST_CORNER_KEY) {
+ throw new IllegalArgumentException("Wrong decorate corner");
+ }
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner];
+ if (cornerDecoratedImageMap == null) {
+ cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>();
+ m_decoratedImageMap[corner] = cornerDecoratedImageMap;
+ }
+ Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage);
+ if (decoratedMap == null) {
+ decoratedMap = new HashMap<Image, Image>();
+ cornerDecoratedImageMap.put(baseImage, decoratedMap);
+ }
+ //
+ Image result = decoratedMap.get(decorator);
+ if (result == null) {
+ Rectangle bib = baseImage.getBounds();
+ Rectangle dib = decorator.getBounds();
+ //
+ result = new Image(Display.getCurrent(), bib.width, bib.height);
+ //
+ GC gc = new GC(result);
+ gc.drawImage(baseImage, 0, 0);
+ if (corner == TOP_LEFT) {
+ gc.drawImage(decorator, 0, 0);
+ } else if (corner == TOP_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, 0);
+ } else if (corner == BOTTOM_LEFT) {
+ gc.drawImage(decorator, 0, bib.height - dib.height);
+ } else if (corner == BOTTOM_RIGHT) {
+ gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height);
+ }
+ gc.dispose();
+ //
+ decoratedMap.put(decorator, result);
+ }
+ return result;
+ }
+ /**
+ * Dispose all of the cached {@link Image}'s.
+ */
+ public static void disposeImages() {
+ // dispose loaded images
+ {
+ for (Image image : m_imageMap.values()) {
+ image.dispose();
+ }
+ m_imageMap.clear();
+ }
+ // dispose decorated images
+ for (int i = 0; i < m_decoratedImageMap.length; i++) {
+ Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i];
+ if (cornerDecoratedImageMap != null) {
+ for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) {
+ for (Image image : decoratedMap.values()) {
+ image.dispose();
+ }
+ decoratedMap.clear();
+ }
+ cornerDecoratedImageMap.clear();
+ }
+ }
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Font
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps font names to fonts.
+ */
+ private static Map<String, Font> m_fontMap = new HashMap<String, Font>();
+ /**
+ * Maps fonts to their bold versions.
+ */
+ private static Map<Font, Font> m_fontToBoldFontMap = new HashMap<Font, Font>();
+ /**
+ * Returns a {@link Font} based on its name, height and style.
+ *
+ * @param name
+ * the name of the font
+ * @param height
+ * the height of the font
+ * @param style
+ * the style of the font
+ * @return {@link Font} The font matching the name, height and style
+ */
+ public static Font getFont(String name, int height, int style) {
+ return getFont(name, height, style, false, false);
+ }
+ /**
+ * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline
+ * flags are also supported.
+ *
+ * @param name
+ * the name of the font
+ * @param size
+ * the size of the font
+ * @param style
+ * the style of the font
+ * @param strikeout
+ * the strikeout flag (warning: Windows only)
+ * @param underline
+ * the underline flag (warning: Windows only)
+ * @return {@link Font} The font matching the name, height, style, strikeout and underline
+ */
+ public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) {
+ String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline;
+ Font font = m_fontMap.get(fontName);
+ if (font == null) {
+ FontData fontData = new FontData(name, size, style);
+ if (strikeout || underline) {
+ try {
+ Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$
+ Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$
+ if (logFont != null && logFontClass != null) {
+ if (strikeout) {
+ logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ if (underline) {
+ logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$
+ }
+ }
+ } catch (Throwable e) {
+ System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ font = new Font(Display.getCurrent(), fontData);
+ m_fontMap.put(fontName, font);
+ }
+ return font;
+ }
+ /**
+ * Returns a bold version of the given {@link Font}.
+ *
+ * @param baseFont
+ * the {@link Font} for which a bold version is desired
+ * @return the bold version of the given {@link Font}
+ */
+ public static Font getBoldFont(Font baseFont) {
+ Font font = m_fontToBoldFontMap.get(baseFont);
+ if (font == null) {
+ FontData fontDatas[] = baseFont.getFontData();
+ FontData data = fontDatas[0];
+ font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD);
+ m_fontToBoldFontMap.put(baseFont, font);
+ }
+ return font;
+ }
+ /**
+ * Dispose all of the cached {@link Font}'s.
+ */
+ public static void disposeFonts() {
+ // clear fonts
+ for (Font font : m_fontMap.values()) {
+ font.dispose();
+ }
+ m_fontMap.clear();
+ // clear bold fonts
+ for (Font font : m_fontToBoldFontMap.values()) {
+ font.dispose();
+ }
+ m_fontToBoldFontMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // Cursor
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Maps IDs to cursors.
+ */
+ private static Map<Integer, Cursor> m_idToCursorMap = new HashMap<Integer, Cursor>();
+ /**
+ * Returns the system cursor matching the specific ID.
+ *
+ * @param id
+ * int The ID value for the cursor
+ * @return Cursor The system cursor matching the specific ID
+ */
+ public static Cursor getCursor(int id) {
+ Integer key = Integer.valueOf(id);
+ Cursor cursor = m_idToCursorMap.get(key);
+ if (cursor == null) {
+ cursor = new Cursor(Display.getDefault(), id);
+ m_idToCursorMap.put(key, cursor);
+ }
+ return cursor;
+ }
+ /**
+ * Dispose all of the cached cursors.
+ */
+ public static void disposeCursors() {
+ for (Cursor cursor : m_idToCursorMap.values()) {
+ cursor.dispose();
+ }
+ m_idToCursorMap.clear();
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ //
+ // General
+ //
+ ////////////////////////////////////////////////////////////////////////////
+ /**
+ * Dispose of cached objects and their underlying OS resources. This should only be called when the cached
+ * objects are no longer needed (e.g. on application shutdown).
+ */
+ public static void dispose() {
+ disposeColors();
+ disposeImages();
+ disposeFonts();
+ disposeCursors();
+ }
+}