| Summary: | [backbone service] EditorUtils.getTransactionalEditingDomain() can return null | ||
|---|---|---|---|
| Product: | [Modeling] Papyrus | Reporter: | Patrick Tessier <Patrick.Tessier> |
| Component: | Core | Assignee: | Cedric Dumoulin <cedric.dumoulin> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | tatiana.fesenko |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
| Bug Depends on: | 319267 | ||
| Bug Blocks: | |||
|
Description
Patrick Tessier
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 |