eu.etaxonomy.cdm.persistence.dao.reference,
eu.etaxonomy.cdm.persistence.dao.taxon,
eu.etaxonomy.cdm.persistence.dao.validation,
+ eu.etaxonomy.cdm.persistence.dto,
eu.etaxonomy.cdm.persistence.fetch,
eu.etaxonomy.cdm.persistence.hibernate,
eu.etaxonomy.cdm.persistence.hibernate.permission,
style="push">
<visibleWhen
checkEnabled="true">
+ <and>
<with
variable="selection">
<count
value="+">
</count>
</with>
+ <reference
+ definitionId="isIndividualsAssociation">
+ </reference>
+ </and>
</visibleWhen>
</command>
<command
</test>
</with>
</definition>
+ <definition
+ id="isIndividualsAssociation">
+ <with
+ variable="selection">
+ <test
+ property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isIndividualsAssociation">
+ </test>
+ </with>
+ </definition>
<definition
id="isSequence">
<with
class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DescriptionsMenuPropertyTester"
id="eu.etaxonomy.taxeditor.descriptions.PropertyTester"
namespace="eu.etaxonomy.taxeditor.descriptions.propertyTester"
- properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor"
+ properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor, isIndividualsAssociation"
type="org.eclipse.jface.viewers.TreeSelection">
</propertyTester>
<propertyTester
}
}
}
- DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
- try {
- EditorUtil.open(input);
- } catch (PartInitException e) {
- MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivate Editor", e);
- } catch (NullPointerException npe){
- MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivate Editor. The derivate hierarchy is corrupted!", npe);
+ if(!selectedElementUUIDs.isEmpty()){
+ DerivateViewEditorInput input = new DerivateViewEditorInput(selectedElementUUIDs);
+ try {
+ EditorUtil.open(input);
+ } catch (PartInitException e) {
+ MessagingUtils.error(OpenDerivateViewHandler.class, "Could not open Derivate Editor", e);
+ } catch (NullPointerException npe){
+ MessagingUtils.messageDialog("Failed to open Editor", OpenDerivateViewHandler.class, "Could not open Derivate Editor. The derivate hierarchy is corrupted!", npe);
+ }
+ }
+ else{
+ MessagingUtils.informationDialog("Empty selection", "No Specimen selected.");
}
}
return null;
import eu.etaxonomy.cdm.api.service.dto.FindByIdentifierDTO;
import eu.etaxonomy.cdm.api.service.pager.Pager;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
-import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.common.Annotation;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.ISourceable;
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.dto.TermDto;
import eu.etaxonomy.cdm.persistence.query.Grouping;
import eu.etaxonomy.cdm.persistence.query.MatchMode;
import eu.etaxonomy.cdm.persistence.query.OrderHint;
defaultService.moveDescriptionElementsToDescription(descriptionElements, targetDescription, isPaste);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageNamedAreasInUse(java.lang.Integer, java.lang.Integer, java.util.List)
- */
- @Override
- public Pager<NamedArea> pageNamedAreasInUse(Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
- return defaultService.pageNamedAreasInUse(pageSize, pageNumber, propertyPaths);
- }
-
/* (non-Javadoc)
* @see eu.etaxonomy.cdm.api.service.IDescriptionService#getOrderedDistributions(java.util.Set, boolean, boolean, java.util.Set, java.util.Set, java.util.List)
*/
public DescriptionBase findWithoutFlush(UUID uuid) {
return defaultService.findWithoutFlush(uuid);
}
-
+
@Override
public <S extends DescriptionBase> Pager<FindByIdentifierDTO<S>> findByIdentifier(Class<S> clazz, String identifier, DefinedTerm identifierType, MatchMode matchmode, boolean includeEntity, Integer pageSize, Integer pageNumber, List<String> propertyPaths){
return defaultService.findByIdentifier(clazz, identifier, identifierType, matchmode, includeEntity, pageSize, pageNumber, propertyPaths);
public UUID deleteDescription(DescriptionBase description) {
return defaultService.deleteDescription(description);
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageNamedAreasInUse(boolean, java.lang.Integer, java.lang.Integer)
+ */
+ @Override
+ public Pager<TermDto> pageNamedAreasInUse(boolean includeAllParents, Integer pageSize, Integer pageNumber) {
+ return defaultService.pageNamedAreasInUse(includeAllParents, pageSize, pageNumber);
+ }
}
}
}
try {
- EditorUtil.open(new DerivateViewEditorInput(specimenUuids));
+ if(!specimenUuids.isEmpty()){
+ EditorUtil.open(new DerivateViewEditorInput(specimenUuids));
+ }
} catch (PartInitException e) {
MessagingUtils.error(DescriptiveViewPart.class, "Could not open Derivate Editor", e);
}
@Override
protected void selectionChanged_internal(IWorkbenchPart part, ISelection selection) {
if(AbstractUtility.getActiveEditor() == null){
+ setPartName("Factual Data");
showEmptyPage();
return;
}
&& ((IStructuredSelection) selection).getFirstElement() instanceof IDescribable<?>
&& part instanceof IPartContentHasFactualData && !(((IStructuredSelection) selection).getFirstElement() instanceof SpecimenOrObservationBase && part instanceof BulkEditor)){
featureNodeContainerCache.clear();
+ setPartName("Factual Data: " + ((IStructuredSelection) selection).getFirstElement());
showViewer(part, (IStructuredSelection) selection);
return;
}
else{
+ setPartName("Factual Data");
showEmptyPage();
}
}
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
+import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
import eu.etaxonomy.cdm.model.media.Media;
import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
private static final String MEDIA = "isMedia";
private static final String FEATURE_NODE_CONTAINER = "isFeatureNodeContainer";
private static final String DESCRIPTION = "isDescription";
+ private static final String INDIVIDUALS_ASSOCIATION = "isIndividualsAssociation";
private static final String DESCRIPTION_ELEMENT = "isDescriptionElement";
private static final String DELETABLE = "isDeletable";
private static final String IMAGE_GALLERY = "isImageGallery";
else if(DESCRIPTION.equals(property)){
return isDescription(selectedElements);
}
+ else if(INDIVIDUALS_ASSOCIATION.equals(property)){
+ return isIndividualsAssociation(selectedElements);
+ }
else if(DESCRIPTION_ELEMENT.equals(property)){
return isDescriptionElement(selectedElements);
}
private boolean isImageGallery(Object[] selectedElements) {
for (Object object : selectedElements){
- if(!(object instanceof DescriptionBase) || !((DescriptionBase) object).isImageGallery()){
+ if(!(object instanceof DescriptionBase) || !((DescriptionBase<?>) object).isImageGallery()){
return false;
}
}
return true;
}
+ private boolean isIndividualsAssociation(Object[] selectedElements) {
+ for (Object object : selectedElements){
+ if(!(object instanceof IndividualsAssociation)){
+ return false;
+ }
+ }
+ return true;
+ }
+
private boolean isMedia(Object[] selectedElements) {
for (Object object : selectedElements){
if(!(object instanceof Media)){