final DomElement domElement = CommonModelManager.getInstance().getDomElement(getElement());
if (domElement != null && domElement.getXmlTag() != null) {
final XmlFile file = domElement.getRoot().getFile();
final VirtualFile virtualFile = file.getVirtualFile();
if (virtualFile != null && virtualFile.isValid()) {
return new OpenFileDescriptor(file.getManager().getProject(), virtualFile, domElement.getXmlTag().getTextRange().getStartOffset());
}
}
final JamElement annoElement = CommonModelManager.getInstance().getJamElement(getElement());
if (annoElement != null && annoElement.getIdentifyingAnnotation() != null) {
final PsiFile file = annoElement.getIdentifyingAnnotation().getContainingFile();
final VirtualFile virtualFile = file.getVirtualFile();
if (virtualFile != null && virtualFile.isValid()) {
return new OpenFileDescriptor(file.getManager().getProject(), virtualFile, annoElement.getIdentifyingAnnotation().getTextRange().getStartOffset());
}
}
return null;
}