Source:
protected void handleDoubleClick(DoubleClickEvent anEvent) { IStructuredSelection selection = (IStructuredSelection) anEvent.getSelection(); Object element = selection.getFirstElement(); if (element instanceof IFile && new FileQuery((IFile) element).isSessionResourceFile()) { IEditorReference[] airdEditorReferences = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findEditors(new FileEditorInput((IFile) element), "org.eclipse.sirius.ui.editor.session", IWorkbenchPage.MATCH_ID); if (airdEditorReferences.length > 0) { try { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(new FileEditorInput((IFile) element), "org.eclipse.sirius.ui.editor.session"); } catch (PartInitException e) { SiriusEditPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SiriusEditPlugin.ID, e.getLocalizedMessage(), e)); } } else { super.handleDoubleClick(anEvent); } } else { super.handleDoubleClick(anEvent); } if (element instanceof IProject) { Option<ModelingProject> optionalModelingProject = ModelingProject.asModelingProject((IProject) element); if (optionalModelingProject.some()) { Option<URI> optionalMainSessionFileURI = Options.newNone(); try { optionalMainSessionFileURI = optionalModelingProject.get().getMainRepresentationsFileURI(new NullProgressMonitor(), false, true); } catch (IllegalArgumentException e) { IProject project = optionalModelingProject.get().getProject(); Job invalidModelingProjectMarkerUpdaterJob = new InvalidModelingProjectMarkerUpdaterJob(project, e.getMessage()); invalidModelingProjectMarkerUpdaterJob.schedule(); } if (optionalMainSessionFileURI.some()) { ModelingProjectManager.INSTANCE.loadAndOpenRepresentationsFile(optionalMainSessionFileURI.get()); } } } }

Target:
protected void handleDoubleClick(DoubleClickEvent anEvent) { IStructuredSelection selection = (IStructuredSelection) anEvent.getSelection(); Object element = selection.getFirstElement(); if (element instanceof IFile && new FileQuery((IFile) element).isSessionResourceFile()) { IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); FileEditorInput fileEditorInput = new FileEditorInput((IFile) element); IEditorReference[] airdEditorReferences = activePage.findEditors(fileEditorInput, SESSION_EDITOR_ID, IWorkbenchPage.MATCH_ID); if (airdEditorReferences.length > 0) { try { activePage.openEditor(fileEditorInput, SESSION_EDITOR_ID); } catch (PartInitException e) { SiriusEditPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SiriusEditPlugin.ID, e.getLocalizedMessage(), e)); } } else { super.handleDoubleClick(anEvent); } } else { super.handleDoubleClick(anEvent); } if (element instanceof IProject) { Option<ModelingProject> optionalModelingProject = ModelingProject.asModelingProject((IProject) element); if (optionalModelingProject.some()) { Option<URI> optionalMainSessionFileURI = Options.newNone(); try { optionalMainSessionFileURI = optionalModelingProject.get().getMainRepresentationsFileURI(new NullProgressMonitor(), false, true); } catch (IllegalArgumentException e) { IProject project = optionalModelingProject.get().getProject(); Job invalidModelingProjectMarkerUpdaterJob = new InvalidModelingProjectMarkerUpdaterJob(project, e.getMessage()); invalidModelingProjectMarkerUpdaterJob.schedule(); } if (optionalMainSessionFileURI.some()) { ModelingProjectManager.INSTANCE.loadAndOpenRepresentationsFile(optionalMainSessionFileURI.get()); } } } }