if(selectedObject instanceof ReferenceSearchViewTreeNode) {
ReferenceSearchViewTreeNode treeNode = (ReferenceSearchViewTreeNode) selectedObject;
Object description = treeNode.getDescription();
// open resource or a reference (standard EReference, or the PP way).
if(description instanceof IReferenceDescription) {
IReferenceDescription referenceDescription = (IReferenceDescription) description;
// Asssume that the PP way is always to pass null as EReference
if(referenceDescription.getEReference() != null) {
uriEditorOpener.open(
referenceDescription.getSourceEObjectUri(), referenceDescription.getEReference(),
referenceDescription.getIndexInList(), true);
}
else {
// Do it the PP way.
uriEditorOpener.open(referenceDescription.getSourceEObjectUri(), true);
}
}
else if(description instanceof IResourceDescription) {
uriEditorOpener.open(((IResourceDescription) description).getURI(), true);
}