Revision baa11275
Added by Patrick Plitzner almost 8 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/NavigationUtil.java | ||
---|---|---|
66 | 66 |
*/ |
67 | 67 |
public static void openEditor(UuidAndTitleCache uuidAndTitleCache){ |
68 | 68 |
Class type = uuidAndTitleCache.getType(); |
69 |
ICdmBase cdmBase = null; |
|
69 | 70 |
if(type.equals(Classification.class)){ |
70 |
Classification classification = CdmStore.getService(IClassificationService.class).load(uuidAndTitleCache.getUuid()); |
|
71 |
openEditor(classification); |
|
71 |
cdmBase = CdmStore.getService(IClassificationService.class).load(uuidAndTitleCache.getUuid()); |
|
72 | 72 |
} |
73 | 73 |
else if(type.equals(TaxonNode.class)){ |
74 |
TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(uuidAndTitleCache.getUuid()); |
|
75 |
openEditor(taxonNode); |
|
74 |
cdmBase = CdmStore.getService(ITaxonNodeService.class).load(uuidAndTitleCache.getUuid()); |
|
76 | 75 |
} |
77 | 76 |
else if(TaxonBase.class.isAssignableFrom(type)){ |
78 |
TaxonBase taxonBase = CdmStore.getService(ITaxonService.class).load(uuidAndTitleCache.getUuid()); |
|
79 |
openEditor(taxonBase); |
|
77 |
cdmBase = CdmStore.getService(ITaxonService.class).load(uuidAndTitleCache.getUuid()); |
|
80 | 78 |
} |
81 | 79 |
else if(type.equals(TaxonNameBase.class)){ |
82 |
TaxonNameBase nameBase = CdmStore.getService(INameService.class).load(uuidAndTitleCache.getUuid()); |
|
83 |
openEditor(nameBase); |
|
80 |
cdmBase = CdmStore.getService(INameService.class).load(uuidAndTitleCache.getUuid()); |
|
84 | 81 |
} |
85 | 82 |
else{ |
86 | 83 |
MessagingUtils.warningDialog("Unknown type", NavigationUtil.class, "There is no editor available to open this object."); |
87 | 84 |
} |
85 |
if(cdmBase!=null){ |
|
86 |
openEditor(cdmBase); |
|
87 |
} |
|
88 |
else{ |
|
89 |
MessagingUtils.warningDialog("Cdm entity not found", NavigationUtil.class, "CDM entity could not be found in the database."); |
|
90 |
} |
|
88 | 91 |
} |
89 | 92 |
|
90 | 93 |
public static void openEditor(ICdmBase selectedObject){ |
Also available in: Unified diff
Fix potential NPE