Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Modifying semantic element starting from an IMarker
Modifying semantic element starting from an IMarker [message #1754734] Tue, 21 February 2017 20:33 Go to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi,

I am trying to bridge Epsilon's EVL with Sirius so that the former can be used to define constraints and quick fixes for diagrams constructed with the latter (similarly to [1]). I'm almost there but I'm having trouble implementing quick fixes, hence this post.

Assuming that I've got hold of a Sirius (org.eclipse.sirius.diagram.ui.diagnostic) problem marker (org.eclipse.core.resources.IMarker) with the following attributes, how can I run code that modifies features of its underlying semantic element (e.g. if the semantic element is a Person, change its name from X to Y)?

elementId -> _shUpEPd-EeadXOjn8SEqIQ
severity -> 2
DIAGRAM_URI -> platform:/resource/basicfamily.sample/representations.aird#_sg7ngfd-EeadXOjn8SEqIQ
org.eclipse.ui.editorID -> org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditorID
location -> lola::<Man>
SEMANTIC_URI -> platform:/resource/basicfamily.sample/example.basicfamily#//@members.10
message -> Invariant Grumpy failed for Man [name=, ]


Cheers,
Dimitris

[1] http://www.eclipse.org/epsilon/doc/articles/evl-gmf-integration/
Re: Modifying semantic element starting from an IMarker [message #1754747 is a reply to message #1754734] Tue, 21 February 2017 22:27 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi again,

To refine my question, I suspect that I need to access 1) the semantic element (EObject) behind the marker and 2) its (Transactional?)EditingDomain so that I can run the modification code through its CommandStack. Any advice on how to get hold of these would be appreciated.

Cheers,
Dimitris
Re: Modifying semantic element starting from an IMarker [message #1754764 is a reply to message #1754747] Wed, 22 February 2017 08:30 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Dimitris,

You can find how Sirius manages those markers and attributes to retrieve the element or the editing domain:
. org.eclipse.sirius.diagram.ui.internal.providers.SiriusValidationDecoratorProvider.StatusDecorator.refresh()
. org.eclipse.sirius.diagram.ui.internal.quickfix.ValidationFixResolution.getMarkedView(Session, IMarker)

Note that you could also define validation rules and quick fixes directly in your modeler specification model (see blog post http://melb.enix.org/sirius/validation/)

Regards,

[Updated on: Wed, 22 February 2017 08:31]

Report message to a moderator

Re: Modifying semantic element starting from an IMarker [message #1754917 is a reply to message #1754764] Thu, 23 February 2017 22:41 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Many thanks!

Dimitris
Previous Topic:Create Node from another model in diagram editor
Next Topic:Create programmatically DNodeContainer
Goto Forum:
  


Current Time: Tue Apr 16 12:41:17 GMT 2024

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

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

Back to the top