use of org.obeonetwork.dsl.environment.binding.dialect.ui.editor.BindingTreeEditor in project InformationSystem by ObeoNetwork.
the class BindingDialectUIServices method openEditor.
@Override
public IEditorPart openEditor(Session session, DRepresentation representation, IProgressMonitor monitor) {
if (representation instanceof DBindingEditor) {
monitor.beginTask("Opening binding editor", 1);
URI uri = EcoreUtil.getURI(representation);
final TransactionalEditingDomain domain = session.getTransactionalEditingDomain();
final IEditorInput editorInput = new SessionEditorInput(uri, getEditorName(representation), session);
RunnableWithResult<IEditorPart> runnable = new RunnableWithResult.Impl<IEditorPart>() {
@Override
public void run() {
final IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
try {
setResult(page.openEditor(editorInput, BindingTreeEditor.ID));
} catch (final PartInitException e) {
// silent catch
}
}
};
PlatformUI.getWorkbench().getDisplay().syncExec(runnable);
Object result = runnable.getResult();
if (result instanceof IEditorPart && canHandleEditor((IEditorPart) result)) {
// Activation of the refresh of the DBindingEditor property page
if (result instanceof BindingTreeEditor) {
// TODO v�rifier s'il faut enlever des choses
doRefresh((DBindingEditor) representation, domain);
}
return (IEditorPart) result;
}
monitor.worked(1);
monitor.done();
}
return null;
}
Aggregations