* {@inheritDoc}
*/
public void init(DerivateViewEditorInput editorInput){
- this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
- this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
+ this.derivateToRootEntityMap = new HashMap<>();
+ this.rootElements = new HashSet<>();
//init tree
Collection<UUID> derivativeUuids = editorInput.getDerivativeUuids();
List<SpecimenOrObservationBase> derivates = null;
if(derivativeUuids!=null){
- this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
- this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
+ this.derivateToRootEntityMap = new HashMap<>();
+ this.rootElements = new HashSet<>();
derivates = CdmStore.getService(IOccurrenceService.class).load(new ArrayList(derivativeUuids), SPECIMEN_INIT_STRATEGY);
}
updateRootEntities(derivates);
public void updateRootEntities(List<SpecimenOrObservationBase> derivates) {
if(derivates!=null){
- this.derivateToRootEntityMap = new HashMap<SpecimenOrObservationBase<?>, SpecimenOrObservationBase<?>>();
- this.rootElements = new HashSet<SpecimenOrObservationBase<?>>();
+ this.derivateToRootEntityMap = new HashMap<>();
+ this.rootElements = new HashSet<>();
for (SpecimenOrObservationBase derivate : derivates) {
if(derivate instanceof FieldUnit){
//set selection to derivatives if the filter criteria
//taxon assignment or derivative type are set
if(derivates!=null && !derivateSearchCompositeController.isDefaultSearch()){
- List<TreeNode> nodesToSelect = new ArrayList<TreeNode>();
+ List<TreeNode> nodesToSelect = new ArrayList<>();
for (SpecimenOrObservationBase specimenOrObservationBase : derivates) {
nodesToSelect.add(new TreeNode(specimenOrObservationBase));
}
// commit the conversation and start a new transaction immediately
conversation.commit(true);
- CdmStore.getService(IOccurrenceService.class).merge(new ArrayList<SpecimenOrObservationBase>(rootElements), true);
+ CdmStore.getService(IOccurrenceService.class).merge(new ArrayList<>(rootElements), true);
monitor.worked(1);
"sources" //$NON-NLS-1$
});
Map<Object, List<String>> specimenPropertyPathMap =
- new HashMap<Object, List<String>>();
+ new HashMap<>();
specimenPropertyPathMap.put(SpecimenOrObservationBase.class,specimenPropertyPaths);
return specimenPropertyPathMap;
}
}
if(selectedTaxon!=null){
Collection<SpecimenOrObservationBase> fieldUnits = CdmStore.getService(IOccurrenceService.class).listFieldUnitsByAssociatedTaxon(selectedTaxon, null, null);
- Collection<UUID> uuids = new HashSet<UUID>();
+ Collection<UUID> uuids = new HashSet<>();
for (SpecimenOrObservationBase specimenOrObservationBase : fieldUnits) {
uuids.add(specimenOrObservationBase.getUuid());
}
*/
@Override
public List<SpecimenOrObservationBase<?>> getRootEntities() {
- return new ArrayList<SpecimenOrObservationBase<?>>(rootElements);
+ return new ArrayList<>(rootElements);
}
public void toggleListenToSelectionChange(MPart part) {