Skip to content

Commit

Permalink
Fix class loader circularity exception on UML Designer startup
Browse files Browse the repository at this point in the history
  • Loading branch information
mbats committed Jul 7, 2014
1 parent 2fb2438 commit f3a76aa
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 14 deletions.
6 changes: 6 additions & 0 deletions plugins/org.obeonetwork.dsl.uml2.design/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,10 @@ Contributors:
</constraints>
</constraintProvider>
</extension>
<extension
point="org.eclipse.sirius.sessionManagerListener">
<listener
class="org.obeonetwork.dsl.uml2.design.UmlDesignerSessionManagerListener">
</listener>
</extension>
</plugin>
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -45,8 +41,6 @@ public class UMLDesignerPlugin extends AbstractUIPlugin {
*/
private static Set<Viewpoint> viewpoints;

private SessionManagerListener notifWhenSessionAreCreated;

/**
* The constructor.
*/
Expand All @@ -62,14 +56,6 @@ public void start(BundleContext context) throws Exception {
viewpoints = new HashSet<Viewpoint>();
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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <a href="mailto:[email protected]">[email protected]</a>
*/
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
}

}

0 comments on commit f3a76aa

Please sign in to comment.