private void setCursorPositionToPropertyValue(XMLMultiPageEditorPart xmlEditor, ElementImpl propertyElement) {
IEditorPart[] editorParts = xmlEditor.findEditors(xmlEditor.getEditorInput());
for (IEditorPart currEditorPart : editorParts) {
if (currEditorPart instanceof StructuredTextEditor) {
StructuredTextEditor structuredTextEditor = (StructuredTextEditor) currEditorPart;
int propertyElementStartOffset = propertyElement.getStartOffset();
String propertyElementTextContent = propertyElement.getStartStructuredDocumentRegion().getFullText();
String valueAttributeStartString = "value=\"";
int valueAttributeStartIndex = propertyElementTextContent.indexOf(valueAttributeStartString)
+ valueAttributeStartString.length();
if (valueAttributeStartIndex > 0) {
int documentOffset = propertyElementStartOffset + valueAttributeStartIndex;
structuredTextEditor.selectAndReveal(documentOffset, 0);
currEditorPart.setFocus();
}
}
}
}