*/
public static void openEditor(UuidAndTitleCache uuidAndTitleCache){
Class type = uuidAndTitleCache.getType();
+ ICdmBase cdmBase = null;
if(type.equals(Classification.class)){
- Classification classification = CdmStore.getService(IClassificationService.class).load(uuidAndTitleCache.getUuid());
- openEditor(classification);
+ cdmBase = CdmStore.getService(IClassificationService.class).load(uuidAndTitleCache.getUuid());
}
else if(type.equals(TaxonNode.class)){
- TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(uuidAndTitleCache.getUuid());
- openEditor(taxonNode);
+ cdmBase = CdmStore.getService(ITaxonNodeService.class).load(uuidAndTitleCache.getUuid());
}
else if(TaxonBase.class.isAssignableFrom(type)){
- TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).load(uuidAndTitleCache.getUuid());
- openEditor(taxonBase);
+ cdmBase = CdmStore.getService(ITaxonService.class).load(uuidAndTitleCache.getUuid());
}
else if(type.equals(TaxonNameBase.class)){
- TaxonNameBase nameBase = CdmStore.getService(INameService.class).load(uuidAndTitleCache.getUuid());
- openEditor(nameBase);
+ cdmBase = CdmStore.getService(INameService.class).load(uuidAndTitleCache.getUuid());
}
else{
MessagingUtils.warningDialog("Unknown type", NavigationUtil.class, "There is no editor available to open this object.");
}
+ if(cdmBase!=null){
+ openEditor(cdmBase);
+ }
+ else{
+ MessagingUtils.warningDialog("Cdm entity not found", NavigationUtil.class, "CDM entity could not be found in the database.");
+ }
}
public static void openEditor(ICdmBase selectedObject){