public void doubleClick(DoubleClickEvent event) {
ISelection selection = event.getSelection();
if (selection instanceof IStructuredSelection) {
Object selected = ((StructuredSelection) selection).getFirstElement();
if (selected != null && selected instanceof DroolsElement) {
DroolsElement droolsSelected = (DroolsElement) selected;
IFile file = droolsSelected.getFile();
if (file != null) {
try {
IEditorPart editor = IDE.openEditor(getSite().getPage(), file);
if (editor instanceof FormEditor) {
editor = ((FormEditor) editor).getActiveEditor();
}
if (editor instanceof ITextEditor) {
((ITextEditor)editor).selectAndReveal(
droolsSelected.getOffset(), droolsSelected.getLength());
}
} catch (Throwable t) {
DroolsEclipsePlugin.log(t);
}
}