Home » Eclipse Projects » Sirius » Registering New Diagram Extensions
|
Re: Registering New Diagram Extensions [message #1723716 is a reply to message #1723454] |
Wed, 17 February 2016 10:56 |
|
Hello Bailey,
If you add the diagram extensions in a new odesign file (and therefore a
new Viewpoint), once deployed, the user should only have to activate the
new viewpoint to have access to your new palette tools.
How do you deploy new functionalities? If you build an update site with
a feature containing your odesign and identified with a newer version
number, you should be able to install it and avoid having diagram
extensions.
Regards,
Steve
Le 15/02/2016 19:43, Bailey Trenton a écrit :
> Hello,
> Is it possible to register new diagram extensions programmatically in
> an already created diagram file without having to delete the diagram and
> create a new one.
>
> We want to deploy new functionality (new palette tools) into the users
> diagram with out them having to recreate the diagram to pull in the new
> diagram extensions.
>
> Thank you,
> Bailey
>
>
>
--
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: Registering New Diagram Extensions [message #1723734 is a reply to message #1723724] |
Wed, 17 February 2016 13:04 |
|
Bailey,
You can use
org.eclipse.sirius.business.api.session.ViewpointSelector.selectViewpoint(Viewpoint
viewpoint, boolean createNewRepresentations, IProgressMonitor monitor).
To find your Viewpoint model element, you can access the registry
ViewpointRegistry.getInstance().getViewpoints().
There is also a Recording available named ChangeViewpointSelectionCommand.
Regards,
Steve
Le 17/02/2016 12:18, Bailey Trenton a écrit :
> Steve,
> I was wondering how you select new viewpoints programmatically.
> Currently, after they install the new plugin with the new viewpoint
> specification and restart, I use a recording command and a
> ViewpointSelector to select the new viewpoint. This gets called from a
> SessionManagerListener during the notifyAdd method. This works the
> first time through and I am able to drag the new tools onto the
> diagram. However, if I restart my RCP application the tool remains on
> the palette but doesn't function any more, meaning that when I drag from
> the palette onto the diagram nothing gets drawn.
>
> Do I have to do something different if I select new ViewPoints
> programmatically?
> Thanks for you response.
> Bailey
>
>
>
>
--
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: Registering New Diagram Extensions [message #1723755 is a reply to message #1723747] |
Wed, 17 February 2016 16:14 |
|
Hi Bailey,
Ok I probably read your other message to fast, you can stay on your
solution with ViewpointSelector and ViewpointRegistry then.
If I understood correctly your use case,
SessionManagerListener.notifyAdd() is the proper way to trigger the
Viewpoint selection programatically.
I am not sure why the serialization works this way with diagram
extensions, but I can look into it. Did you experience any issue with that?
Regards,
Steve
Le 17/02/2016 16:16, Bailey Trenton a écrit :
> Steve,
> I do use the ViewpointSelector as the way to choose my new viewpoints
> that I get from the ViewpointRegistry. I am trying to stay away from
> non-API/internal code so I don't want to use the
> ChangeViewpointSelectionCommand. I noticed in that command that it
> sorts the viewpoints, does the order of the viewpoints in the diagram
> file matter? I noticed that after I save the diagram with the new
> viewpoints activated, it saves them at the bottom of the diagram file
> under all the other viewpoints specified, but if I delete my old diagram
> and create a new one, the new viewpoints appear at the top. My new
> viewpoints are all diagram extensions if that makes a difference.
> Also is my updating the selected viewpoints in the
> SessionManagerListener notifyAdd() method the best place or is there
> some other place that would be better?
>
> Thanks,
> Brian
--
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: Registering New Diagram Extensions [message #1723763 is a reply to message #1723760] |
Wed, 17 February 2016 17:27 |
|
I do not really see what could cause this kind of behaviour. Do you have
an exception when you try to use the tool?
Sorry to ask again, but as the user need to deploy the new diagram
extensions, why don't you deploy a new version of the odesign with the
additional tools?
Regards,
Steve
Le 17/02/2016 17:58, Bailey Trenton a écrit :
> Steve,
> It works the first time the diagram comes up after activating my new
> viewpoint. I am able to drag the new tool and it draws on the
> diagram. The problem is that if I shutdown my RCP application and
> start it back up again, the tool no longer works. It shows up on the
> palette but doesn't work. I have checked that the new plugin is
> activated and it appears to be. Any thought?
>
> Thanks,
> Brian
--
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: Registering New Diagram Extensions [message #1723804 is a reply to message #1723764] |
Thu, 18 February 2016 07:58 |
|
Bailey,
I do not think that the issue is caused by the serialization, as far as
I know the DiagramContainers are created in the order of the viewpoint
activation. What I mean by that is that the order in which the viewpoint
and diagram are serialized should not really matter for Sirius.
It is unfortunate that you can reproduce the issue only with the
exported RCP, not in debug. The new viewpoint is accessible in the
ViewpointRegistry, but how is deployed the new odesign in the RCP? Is it
every tool that are unusable after restart or maybe only creation tools?
Are the tools using external java services or something that could be
not properly loaded when you restart?
Regards,
Steve
Le 17/02/2016 19:04, Bailey Trenton a écrit :
> Steve,
> No exceptions get thrown that I can see. They may be being caught
> somewhere where I can't see them. Since I can only test this
> functionality in a exported RCP and not in the debugger, I am out of
> luck in seeing exceptions that are not thrown to the console.
> The only thing I can see that is different between me adding the new
> viewpoint to an existing diagram and creating a new diagram with the new
> viewpoints in the order they are listed in the diagram file. I think
> you said you can check on whether or not the order matters in the
> diagram? And if it does, is there a way I can control the order?
>
> The reason is that we want the user to be able to customize their
> diagram with only the tools they need and since every user may need a
> different set we can't generate different odesigns for each potential
> user. Additionally we want them to be able to install new tool to use
> in their existing diagram from other plugins.
>
> Thanks,
> Bailey
--
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
|
|
| |
Goto Forum:
Current Time: Fri Apr 26 08:59:48 GMT 2024
Powered by FUDForum. Page generated in 0.05337 seconds
|