Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcdumoulin2010-06-02 13:59:57 +0000
committercdumoulin2010-06-02 13:59:57 +0000
commit29e85cabb51ccc75c26e60a6fc1a0074e401ee56 (patch)
treeb57afa1bcf242a55956fa9739257672c70d6075f /extraplugins
parent261678042195f1eb7518e9f44f6106629bd3c9a8 (diff)
downloadorg.eclipse.papyrus-29e85cabb51ccc75c26e60a6fc1a0074e401ee56.tar.gz
org.eclipse.papyrus-29e85cabb51ccc75c26e60a6fc1a0074e401ee56.tar.xz
org.eclipse.papyrus-29e85cabb51ccc75c26e60a6fc1a0074e401ee56.zip
ASSIGNED - bug 276286: [Core][Service] Split the ModelLoaderService in sub services
https://bugs.eclipse.org/bugs/show_bug.cgi?id=276286 Remove the error stack appearing when closing the editor. This was cause by a dispose calling an already disposed service. Also, use a transaction in the ExampleService
Diffstat (limited to 'extraplugins')
-rw-r--r--extraplugins/core.examples/org.eclipse.papyrus.example.lifecycleevents/src/org/eclipse/papyrus/example/lifecycleevents/LifeCycleEventsMonitorService.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/extraplugins/core.examples/org.eclipse.papyrus.example.lifecycleevents/src/org/eclipse/papyrus/example/lifecycleevents/LifeCycleEventsMonitorService.java b/extraplugins/core.examples/org.eclipse.papyrus.example.lifecycleevents/src/org/eclipse/papyrus/example/lifecycleevents/LifeCycleEventsMonitorService.java
index 81f7536fd19..f03b35f2176 100644
--- a/extraplugins/core.examples/org.eclipse.papyrus.example.lifecycleevents/src/org/eclipse/papyrus/example/lifecycleevents/LifeCycleEventsMonitorService.java
+++ b/extraplugins/core.examples/org.eclipse.papyrus.example.lifecycleevents/src/org/eclipse/papyrus/example/lifecycleevents/LifeCycleEventsMonitorService.java
@@ -24,6 +24,10 @@ import org.eclipse.papyrus.core.services.ServicesRegistry;
public class LifeCycleEventsMonitorService implements IService {
protected ServicesRegistry servicesRegistry;
+ /**
+ * The object firing event about the Editor lifecycle.
+ */
+ protected ILifeCycleEventsProvider eventProvider;
/**
* Listener on aboutToSave events.
@@ -112,7 +116,7 @@ public class LifeCycleEventsMonitorService implements IService {
*/
private void activate() {
try {
- ILifeCycleEventsProvider eventProvider = servicesRegistry.getService(ILifeCycleEventsProvider.class);
+ eventProvider = servicesRegistry.getService(ILifeCycleEventsProvider.class);
eventProvider.addAboutToDoSaveListener(aboutToSaveListener);
eventProvider.addDoSaveListener(saveListener);
eventProvider.addPostDoSaveListener(postSaveListener);
@@ -128,16 +132,9 @@ public class LifeCycleEventsMonitorService implements IService {
* Deactivate listeners
*/
private void deactivate() {
- try {
- ILifeCycleEventsProvider eventProvider = servicesRegistry.getService(ILifeCycleEventsProvider.class);
eventProvider.removeAboutToDoSaveListener(aboutToSaveListener);
eventProvider.removeDoSaveListener(saveListener);
eventProvider.removePostDoSaveListener(postSaveListener);
- } catch (ServiceException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- // TODO Auto-generated method stub
}

Back to the top