Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Sirius post-condition expression?
Sirius post-condition expression? [message #1608022] Mon, 09 February 2015 08:06 Go to next message
Huy Le is currently offline Huy LeFriend
Messages: 18
Registered: November 2014
Junior Member
Hi,

We already have Precondition Service to prevent creating diagram. But how about the post-service after diagram created?

One of use cases, after diagram loaded/ re-loaded, i would like to activate Read-Only mode, which Not allow user drag/drop/delete/edit any elements in the diagram.

Any solution?

Thanks.

Thanh Huy LE.
Re: Sirius post-condition expression? [message #1610082 is a reply to message #1608022] Tue, 10 February 2015 14:44 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

If I understand right, you want Sirius to behave as a viewer instead of
an editor?
In the DiagramDescription, if you describe only describe a "Delete tool"
with no action in its tasks, you will obtain a diagram where to user is
not able to drag/drop/delete/edit any elements in the diagram. However,
he will be able to move them in the diagram.
Is this solution good enough?

Regards,
Steve

Le 09/02/2015 09:06, Huy Le a écrit :
> Hi,
> We already have Precondition Service to prevent creating diagram. But
> how about the post-service after diagram created?
>
> One of use cases, after diagram loaded/ re-loaded, i would like to
> activate Read-Only mode, which Not allow user drag/drop/delete/edit any
> elements in the diagram.
>
> Any solution?
>
> Thanks.
>
> Thanh Huy LE.


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Sirius post-condition expression? [message #1681050 is a reply to message #1610082] Tue, 17 March 2015 06:45 Go to previous messageGo to next message
Huy Le is currently offline Huy LeFriend
Messages: 18
Registered: November 2014
Junior Member
Hello Steve,

See my answer as below:

If I understand right, you want Sirius to behave as a viewer instead of
an editor?


=> YES.

In the DiagramDescription, if you describe only describe a "Delete tool"
with no action in its tasks, you will obtain a diagram where to user is
not able to drag/drop/delete/edit any elements in the diagram. However,
he will be able to move them in the diagram.
Is this solution good enough?


=> Moving is not allowed as well.

Another solution is removeEditPolicy of each EditPart, but when any change in the model, the policy is reset, the diagram back to editable mode.

I'm still in stuck.
Re: Sirius post-condition expression? [message #1681964 is a reply to message #1681050] Tue, 17 March 2015 14:37 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

Depending your goal, maybe exporting representation as images is enough?
You can do it programmatically by using the API
DialectUIManager.INSTANCE.export(...).
If your really need to use Sirius as a viewer (well a read-only editor),
you either can implement a ResourceSetListener in post-commit which
rolls-back the transaction or implement a IPermissionAuthority that will
return false to the canEditFeature/Instance methods.

Regards,
Steve

Le 17/03/2015 07:45, Huy Le a écrit :
> Hello Steve,
>
> See my answer as below:
>
> If I understand right, you want Sirius to behave as a viewer instead of
> an editor?
>
> => YES.
>
> In the DiagramDescription, if you describe only describe a "Delete tool"
> with no action in its tasks, you will obtain a diagram where to user is
> not able to drag/drop/delete/edit any elements in the diagram. However,
> he will be able to move them in the diagram.
> Is this solution good enough?
>
> => Moving is not allowed as well.
>
> Another solution is removeEditPolicy of each EditPart, but when any
> change in the model, the policy is reset, the diagram back to editable
> mode.
>
> I'm still in stuck.


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Removing element from a list with in an operation
Next Topic:Edge centering problem
Goto Forum:
  


Current Time: Sat Apr 20 00:18:33 GMT 2024

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

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

Back to the top