Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Enable layer programatically
Enable layer programatically [message #1719922] Wed, 13 January 2016 08:56 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Hi,

I have the following setup:

I have two diagram extensions E1 and E2. E1 defines an additional Layer
for a diagram D1. E2 defines an additional Layer for diagram D2.
Additionally, I have a third extension with a layer that only contains
Style Customisations for elements in diagrams D1 and D2 (by using
regular expression in the viewpoint URI/Representation Names).

Now, I don't want the user to see the customisations layer as an option
in the Layer selection combo, so I deselect "optional" in the layer
definition.

Now I add a precondition expression in my style customisations that
checks whether one of E1 or E2 layer is enabled. This works, but maybe
there's a better way?:

Is it possible to enable/disable a 'non-optional' layer programatically?
I could then enable/disable my customisations layer in response to layer
activation of E1,E2.


Thanks,
Felix
Re: Enable layer programatically [message #1720842 is a reply to message #1719922] Thu, 21 January 2016 11:12 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 270
Registered: August 2010
Senior Member
Hi Felix,

You can use
org.eclipse.sirius.diagram.tools.api.command.ChangeLayerActivationCommand to
activate/deactivate a specific layer. But it's possible that at the next
diagram refresh, Sirius decides to add the mandatory layer again, even
if it has been remove before.

Regards,

--
Florian - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Enable layer programatically [message #1721000 is a reply to message #1720842] Fri, 22 January 2016 11:42 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
On 21-Jan-16 12:12, Florian Barbin wrote:
> Hi Felix,
>
> You can use
> org.eclipse.sirius.diagram.tools.api.command.ChangeLayerActivationCommand to
> activate/deactivate a specific layer. But it's possible that at the next
> diagram refresh, Sirius decides to add the mandatory layer again, even
> if it has been remove before.

I see.

Thank you,
Felix

> Regards,
>
Previous Topic:NodeMappingImport loses bordered nodes of imported node
Next Topic:Semantic candidates/precondition expressions for mapping imports
Goto Forum:
  


Current Time: Fri Apr 26 21:58:47 GMT 2024

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

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

Back to the top