public void openLabelEditor(IFile labelFile, String labelKey) {
try {
IEditorPart editor = WorkbenchUtils.openEditor(Plugin.getDefault().getWorkbench(), labelFile);
if (editor instanceof TextEditor) {
ITextEditor textEditor = (ITextEditor) editor;
IDocument doc = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
try {
// search for line starting with label key
FindReplaceDocumentAdapter finder = new FindReplaceDocumentAdapter(doc);
IRegion keyRegion = finder.find(0, "^" + LabelFileEncodingHelper.saveConvert(labelKey,true).replaceAll("\\\\", "\\\\\\\\") + "\\s*=", true, false, false, true);
if (keyRegion != null) {
textEditor.getSelectionProvider().setSelection(new TextSelection(keyRegion.getOffset() + keyRegion.getLength(),0));
}
} catch (BadLocationException e) {
}
}
} catch (PartInitException e) {