Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » ElementTypeRegistry instance load/reload problem(Two graphical plugin in same Eclipse)
ElementTypeRegistry instance load/reload problem [message #1767288] Tue, 04 July 2017 13:07 Go to next message
Ismael Soulama is currently offline Ismael SoulamaFriend
Messages: 39
Registered: November 2016
Member
Hi there,
I'm testing an old Eclipse plugin based on GMF, and another plugin based on Papyrus on the same Eclipse installation.

The GMF plugin and its diagram editor work fine, but when I try to edit a Papyrus diagram, I can't drag'n'drop any item from the palette.
I got:
!ENTRY org.eclipse.ui 4 0 2017-07-04 14:43:17.683
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy.getCreateCommand(DefaultSemanticEditPolicy.java:153)
	at org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy.getSemanticCommandSwitch(DefaultSemanticEditPolicy.java:118)
	at org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy.getSemanticCommand(DefaultSemanticEditPolicy.java:78)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.SemanticEditPolicy.getCommand(SemanticEditPolicy.java:69)
	at org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy.getCommand(DefaultSemanticEditPolicy.java:72)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$1(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$1.run(GraphicalEditPart.java:482)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.runExclusive(PapyrusROTransactionalEditingDomain.java:271)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:477)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy.getCreateElementAndViewCommand(CreationEditPolicy.java:340)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy.getCommand(CreationEditPolicy.java:87)
	at org.eclipse.papyrus.infra.gmfdiag.dnd.policy.CustomizableDropEditPolicy.getCommand(CustomizableDropEditPolicy.java:118)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$1(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$1.run(GraphicalEditPart.java:482)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.runExclusive(PapyrusROTransactionalEditingDomain.java:271)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:477)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy.getUnspecifiedTypeCreateCommand(CreationEditPolicy.java:395)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy.getCommand(CreationEditPolicy.java:85)
	at org.eclipse.papyrus.infra.gmfdiag.dnd.policy.CustomizableDropEditPolicy.getCommand(CustomizableDropEditPolicy.java:118)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.access$1(GraphicalEditPart.java:1)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart$1.run(GraphicalEditPart.java:482)
	at org.eclipse.papyrus.infra.emf.readonly.PapyrusROTransactionalEditingDomain.runExclusive(PapyrusROTransactionalEditingDomain.java:271)
	at org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart.getCommand(GraphicalEditPart.java:477)
	at org.eclipse.gef.tools.TargetingTool.getCommand(TargetingTool.java:123)
	at org.eclipse.gmf.runtime.diagram.ui.tools.CreationTool.getCommand(CreationTool.java:277)
	at org.eclipse.gef.tools.CreationTool.handleMove(CreationTool.java:253)
	at org.eclipse.gmf.runtime.diagram.ui.tools.CreationTool.handleMove(CreationTool.java:258)
	at org.eclipse.gef.tools.AbstractTool.mouseMove(AbstractTool.java:1182)
	at org.eclipse.gef.EditDomain.mouseMove(EditDomain.java:287)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseMoved(DomainEventDispatcher.java:365)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseMove(LightweightSystem.java:543)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:213)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4418)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4236)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3824)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:693)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)


After investigationg, I notice that in the Papyrus palette UMLElementTypes.getElementTypeByUniqueId() is null for every elements.
So the ElementTypeRegistry instance is not reloaded with papyrus metamodels.

While the GMF plugin load its metamodel with
<extension point="org.eclipse.gmf.runtime.emf.type.core.elementTypes" id="element-types">
  ...
</extension>


Is there a way to force the reload of the ElementTypeRegistry instance to load Papyrus metamodels?
Re: ElementTypeRegistry instance load/reload problem [message #1767363 is a reply to message #1767288] Wed, 05 July 2017 08:26 Go to previous messageGo to next message
Ismael Soulama is currently offline Ismael SoulamaFriend
Messages: 39
Registered: November 2016
Member
It seems like the instance created by the GFM plugin is not recreated in Papyrus.
In GMF ElementTypeRegistry, if it's not null it use the same:
public static ElementTypeRegistry getInstance() {

		if (INSTANCE == null) {

			IConfigurationElement[] configs = Platform.getExtensionRegistry()
				.getConfigurationElementsFor(EMFTypePlugin.getPluginId(),
					ELEMENT_TYPES_EXT_P_NAME);

			INSTANCE = new ElementTypeRegistry(configs);
		}
		return INSTANCE;
	}


Maybe Papyrus use it and can't find its metamodels?
Re: ElementTypeRegistry instance load/reload problem [message #1767616 is a reply to message #1767363] Fri, 07 July 2017 16:01 Go to previous message
Ismael Soulama is currently offline Ismael SoulamaFriend
Messages: 39
Registered: November 2016
Member
I continue my investigation, and found that GMF load all providers first.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=190353

This make the GMF plugin look for all providers. It find the UMLParserProvider, witch load the UMLElementTypes, and return null for all shapes... And they stay registered.

Did someone know how to reload the UMLElementTypes once we are in Papyrus context?
Or
Is there a way to provide all shape when GMF try to load them?
Previous Topic:2.0.4 release
Next Topic:<<Trace>> Realization in Palette
Goto Forum:
  


Current Time: Sat Jul 21 15:40:00 GMT 2018

Powered by FUDForum. Page generated in 0.01480 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top