diff --git a/plugins/org.obeonetwork.dsl.uml2.design/plugin.xml b/plugins/org.obeonetwork.dsl.uml2.design/plugin.xml index 3e72ddef8..dd38d4f2c 100644 --- a/plugins/org.obeonetwork.dsl.uml2.design/plugin.xml +++ b/plugins/org.obeonetwork.dsl.uml2.design/plugin.xml @@ -488,4 +488,10 @@ Contributors: + + + + diff --git a/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/UMLDesignerPlugin.java b/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/UMLDesignerPlugin.java index 2ad94cdff..b4f73cc5d 100644 --- a/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/UMLDesignerPlugin.java +++ b/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/UMLDesignerPlugin.java @@ -15,12 +15,8 @@ import org.eclipse.core.runtime.Status; import org.eclipse.sirius.business.api.componentization.ViewpointRegistry; -import org.eclipse.sirius.business.api.session.Session; -import org.eclipse.sirius.business.api.session.SessionManager; -import org.eclipse.sirius.business.api.session.SessionManagerListener; import org.eclipse.sirius.viewpoint.description.Viewpoint; import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.obeonetwork.dsl.uml2.design.services.AutosizeTrigger; import org.osgi.framework.BundleContext; /** @@ -45,8 +41,6 @@ public class UMLDesignerPlugin extends AbstractUIPlugin { */ private static Set viewpoints; - private SessionManagerListener notifWhenSessionAreCreated; - /** * The constructor. */ @@ -62,14 +56,6 @@ public void start(BundleContext context) throws Exception { viewpoints = new HashSet(); viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin( PLUGIN_ID + "/description/uml2.odesign")); - notifWhenSessionAreCreated = new SessionManagerListener.Stub() { - @Override - public void notifyAddSession(Session newSession) { - newSession.getEventBroker().addLocalTrigger(AutosizeTrigger.IS_GMF_NODE_ATTACHMENT, - new AutosizeTrigger(newSession.getTransactionalEditingDomain())); - } - }; - SessionManager.INSTANCE.addSessionsListener(notifWhenSessionAreCreated); } /** diff --git a/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/UmlDesignerSessionManagerListener.java b/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/UmlDesignerSessionManagerListener.java new file mode 100644 index 000000000..203885be1 --- /dev/null +++ b/plugins/org.obeonetwork.dsl.uml2.design/src/org/obeonetwork/dsl/uml2/design/UmlDesignerSessionManagerListener.java @@ -0,0 +1,46 @@ +/******************************************************************************* + * Copyright (c) 2014 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.obeonetwork.dsl.uml2.design; + +import org.eclipse.sirius.business.api.session.Session; +import org.eclipse.sirius.business.api.session.SessionManagerListener; +import org.eclipse.sirius.viewpoint.description.Viewpoint; +import org.obeonetwork.dsl.uml2.design.services.AutosizeTrigger; + +/** + * Session listener. + * + * @author Melanie Bats melanie.bats@obeo.fr + */ +public class UmlDesignerSessionManagerListener implements SessionManagerListener { + + public void notifyAddSession(Session newSession) { + newSession.getEventBroker().addLocalTrigger(AutosizeTrigger.IS_GMF_NODE_ATTACHMENT, + new AutosizeTrigger(newSession.getTransactionalEditingDomain())); + } + + public void notifyRemoveSession(Session removedSession) { + // Nothing + } + + public void viewpointSelected(Viewpoint selectedSirius) { + // Nothing + } + + public void viewpointDeselected(Viewpoint deselectedSirius) { + // Nothing + } + + public void notify(Session updated, int notification) { + // Nothing + } + +}