Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Cannot extend DDiagramImpl or AbstractSpecificDDiagramEditor
Cannot extend DDiagramImpl or AbstractSpecificDDiagramEditor [message #1768710] Fri, 21 July 2017 20:57 Go to next message
Chris Mamorella is currently offline Chris MamorellaFriend
Messages: 34
Registered: June 2013
Member
When I try the following simple class declaration :

public class MyEditor extends AbstractSpecificDDiagramEditor { }

-or-

public class MyEditor extends DDiagramEditorImpl { }

I get this build error: "The hierarchy of the type "MyEditor" is inconsistent"

This error suggests that a plugin dependency references a class that is not accessible. From stack overflow:

"That means class which implemented by you has reference to the interface or class which again references some other classes or interfaces in other libraries and those are not available."

Both DDiagramEditor and AbstractSpecificDDiagramEditor are in:
--- org.eclipse.sirius.diagram.ui --- but it seems like guesswork to know which plugin(s) are needed from here.

Below is a list of my project's current plugin dependencies so the missing plugin(s) must exist somewhere else?

org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.sirius,
org.eclipse.emf.transaction,
org.eclipse.sirius.ui,
org.eclipse.ui.ide,
org.eclipse.gef,
org.eclipse.gmf.runtime.diagram.ui,
org.eclipse.sirius.common,
org.eclipse.sirius.diagram,
org.eclipse.ui.navigator,
org.eclipse.jface,
org.eclipse.sirius.ecore.extender;bundle-version="3.1.1",
org.eclipse.emf.mwe.core,
org.eclipse.emf.ecore,
org.eclipse.ui.navigator.resources,
org.eclipse.core.expressions;bundle-version="3.4.600",
org.eclipse.sirius.diagram.ui;bundle-version="3.1.1",
org.eclipse.sirius.ext.base;bundle-version="3.1.1"

[Updated on: Sat, 22 July 2017 01:35]

Report message to a moderator

Re: Cannot extend DDiagramImpl or AbstractSpecificDDiagramEditor [message #1768835 is a reply to message #1768710] Mon, 24 July 2017 09:05 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
Hello,

I think your project is missing the dependency to "org.eclipse.gmf.runtime.diagram.ui.resources.editor". I tested on the sample project "org.eclipse.sirius.sample.ecore.design" where "EcoreEntitiesReadOnlyEditor extends AbstractSpecificDDiagramEditor" and I also had this "The hierarchy of the type "MyEditor" is inconsistent" error when I removed "org.eclipse.gmf.runtime.diagram.ui.resources.editor".

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Cannot extend DDiagramImpl or AbstractSpecificDDiagramEditor [message #1768879 is a reply to message #1768835] Mon, 24 July 2017 14:32 Go to previous messageGo to next message
Chris Mamorella is currently offline Chris MamorellaFriend
Messages: 34
Registered: June 2013
Member
Steve,

Thank you for that tip! This saved a lot of time from digging through the dependency chain.

As far as opening the custom editor I have followed these instructions:

But the instructions don't indicate how to pass in a custom editor ID to the existing API:

DialectUIManager.INSTANCE.openEditor(session, matchingRepresentation, new NullProgressMonitor());

Diving into the code, DialectUIManager's implementation hard-codes the editor id, so I am faced with the prospect of trying to copy that specific code and inserting my contributing editor ID. This seems like a big hack so I'm wondering if there's a cleaner solution available.
Re: Cannot extend DDiagramImpl or AbstractSpecificDDiagramEditor [message #1768893 is a reply to message #1768879] Mon, 24 July 2017 16:07 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
Indeed, I do not see a good reason for this ID to be hardcoded in DialectUIManager or having another openEditor method where you could give the editor ID. I guess that contributed editors are usually opened using the UI and not programatically. You can open a bugzilla, but I do not known when we will add this to the API.
You will have to either override org.eclipse.sirius.ui.business.internal.dialect.DialectUIManagerImpl.init() to provide your own ID or open you editor using the default expression final IEditorPart editorPart = WorkbenchUtil.getActivePage().openEditor(editorInput, EDITOR_ID);

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Cannot extend DDiagramImpl or AbstractSpecificDDiagramEditor [message #1769714 is a reply to message #1768893] Wed, 02 August 2017 20:37 Go to previous message
Chris Mamorella is currently offline Chris MamorellaFriend
Messages: 34
Registered: June 2013
Member
Steve,

I considered using the default expression:
 final IEditorPart editorPart = WorkbenchUtil.getActivePage().openEditor(editorInput, EDITOR_ID);
but this looks different than the DialectUIServices#openEditor process. As a bit of an experiment to avoid the need to override any Sirius init code, I set the id for my custom editor to:

"org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditorID"

This was mostly an experiment to see if my editor would be activated instead of its parent class DDiagramEditorImpl which uses the same editor ID. Apparently my editor is in fact the one that gets called... but I'm not familiar enough with the extension point contribution mechanisms to know if this can be considered deterministic.

Regards,
Chris

[Updated on: Wed, 02 August 2017 20:40]

Report message to a moderator

Previous Topic:Open Dialog vs Properties View
Next Topic:Select widget for Map.Entry classes
Goto Forum:
  


Current Time: Sun Apr 05 23:55:03 GMT 2020

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

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

Back to the top