Community
Participate
Working Groups
Hi Cédric, I m back with a problem about this method: EditorUtils.getTransactionalEditingDomain() When the editor is not active ( during initialization ) this method returns null. It looks for thanks to the active editor. We have had this problem it the case of model explorer or in other class like this: org.eclipse.papyrus.diagram.common.helper.PreferenceInitializerForElementHelper I wonder if there is no means to avoid that his method return no null during the initialization of Papyrus. Because I think that backbone is already alive.
This method return null because it rely on Workbench.getActiveEditor(), and there is no active editor :-(. The active editor is set after the initialization phase, so you can't get it during the initialization phase. The solution is to provide ourself the ServiceRegistry whenever it is possible. I have improve the documentation around this method, that is designed to be used in ui actions interacting on the currently opened editor and not in initialization phase.
Class /org.eclipse.papyrus.diagram.common/src/org/eclipse/papyrus/diagram/common/util/DiagramCoreServiceUtils.java has been added. It provides methods to get the ServiceRegistry and the TransactionalEditingDomain from a GMF EditPart and EditPolicy. This method should be used instead of the method from EditorUtils.
I close this task