Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Force refresh not working for me
Force refresh not working for me [message #1254927] Sun, 23 February 2014 19:18 Go to next message
Michael Lukaszczyk is currently offline Michael Lukaszczyk
Messages: 14
Registered: November 2013
Junior Member
Hey there,

I created an emf tools extension which evaluates a model and automatically splits model elements into different groups (groupFoo, groupBar for example). Now I have a layer that shows the model elements in different colors. groupFoo in red, groupBar in blue etc... . This all happens with the help of external XML files. Theres no group information within the model. So the model is completely decoupled from this information. Now I defined a tool in my vsp that calls a wizard by clicking on a model element where the user can manually select another group for an element in case the splitting algorithm got it wrong. After finishing the XML file gets rewritten. I activated "force refresh" for the tool by clicking the checkBox. The problem is, that the colors don´t change in the diagram. I have to right click on the canvas and hit refresh again or deactivate and activate the color layer again. Is there a chance that I can invoke this kind of "hard" refresh after the wizard closed?

thanks,

Michael
Re: Force refresh not working for me [message #1255468 is a reply to message #1254927] Mon, 24 February 2014 08:20 Go to previous messageGo to next message
Florian Barbin is currently offline Florian Barbin
Messages: 31
Registered: August 2010
Member
Hi Micheal,

Can you provide to us a sample project that illustrates your issue or at
least the conditional style expressions used in your layer to customize
your elements colors?

A possible explanation I see is that your external XMI Resource is
loaded in an other resource set than the one used by Sirius to load the
model and the *aird resource.

Regards,

Florian

On 24/02/2014 01:18, Michael Lukaszczyk wrote:
> Hey there,
> I created an emf tools extension which evaluates a model and
> automatically splits model elements into different groups (groupFoo,
> groupBar for example). Now I have a layer that shows the model elements
> in different colors. groupFoo in red, groupBar in blue etc... . This all
> happens with the help of external XML files. Theres no group information
> within the model. So the model is completely decoupled from this
> information. Now I defined a tool in my vsp that calls a wizard by
> clicking on a model element where the user can manually select another
> group for an element in case the splitting algorithm got it wrong. After
> finishing the XML file gets rewritten. I activated "force refresh" for
> the tool by clicking the checkBox. The problem is, that the colors don´t
> change in the diagram. I have to right click on the canvas and hit
> refresh again or deactivate and activate the color layer again. Is there
> a chance that I can invoke this kind of "hard" refresh after the wizard
> closed?
>
> thanks,
>
> Michael
Re: Force refresh not working for me [message #1266141 is a reply to message #1255468] Thu, 06 March 2014 21:37 Go to previous messageGo to next message
Michael Lukaszczyk is currently offline Michael Lukaszczyk
Messages: 14
Registered: November 2013
Junior Member
Hey Florian,

thanks for the reply and sorry for the late response. As I mentioned, I am not touching the XMI resource. The splitting information is completely decoupled from the model information so the model elements don´t keep any information about the splitting groups or colors. The information for this is in an external XML file. So the diagram does not refresh after I started my service. After a manual refresh of the diagram the data renders fine. What I want is to fire up a complete diagram refresh at the end of my external java service. I found something like a org.eclipse.sirius.diagram.part.SiriusDiagramUpdateCommand Handler. But I´m not sure if this is the handler I need and whats the best way to call it. I would be happy if you could help me out.

Thanks,

Michael
Re: Force refresh not working for me [message #1266354 is a reply to message #1266141] Fri, 07 March 2014 05:29 Go to previous messageGo to next message
Florian Barbin is currently offline Florian Barbin
Messages: 31
Registered: August 2010
Member
Hey Michael,

Because your external resource is outside the session editing domain,
Sirius do not detect modifications.
If you can't integrate this resource in the session semantic resources,
you can execute a RefreshRepresentationsCommand
(org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand).
This command is called when you perform a manual refresh on the diagram.

Regards,

Florian

On 07/03/2014 03:37, Michael Lukaszczyk wrote:
> Hey Florian,
>
> thanks for the reply and sorry for the late response. As I mentioned, I
> am not touching the XMI resource. The splitting information is
> completely decoupled from the model information so the model elements
> don´t keep any information about the splitting groups or colors. The
> information for this is in an external XML file. So the diagram does not
> refresh after I started my service. After a manual refresh of the
> diagram the data renders fine. What I want is to fire up a complete
> diagram refresh at the end of my external java service. I found
> something like a
> org.eclipse.sirius.diagram.part.SiriusDiagramUpdateCommand Handler. But
> I´m not sure if this is the handler I need and whats the best way to
> call it. I would be happy if you could help me out.
>
> Thanks,
>
> Michael
Re: Force refresh not working for me [message #1268807 is a reply to message #1254927] Mon, 10 March 2014 22:12 Go to previous messageGo to next message
Michael Lukaszczyk is currently offline Michael Lukaszczyk
Messages: 14
Registered: November 2013
Junior Member
Thanks! But could you provide an explanation on how to call this command programmatically? I tried it with this ( http://devblog.virtage.com/2012/09/snippet-of-the-day-execute-eclipse-command-programmatically/ ) snippet but it says: Trying to execute a command that is not defined. org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand. I thought that this command is already defined by sirius and I could use it out of the box. But this doesn´t seem to be the case. Whats missing?
Re: Force refresh not working for me [message #1268990 is a reply to message #1268807] Tue, 11 March 2014 04:40 Go to previous message
Florian Barbin is currently offline Florian Barbin
Messages: 31
Registered: August 2010
Member
Hi Michael,

You should call the command explicitly as it's done within this Sirius
private method:
org.eclipse.sirius.diagram.tools.internal.actions.refresh.RefreshRunnableWithProgress.refreshFromDiagramEditPart(IDDiagramEditPart,
IprogressMonitor

TransactionalEditingDomain domain =
TransactionUtil.getEditingDomain(dDiagram);
domain.getCommandStack().execute(new
RefreshRepresentationsCommand(domain, new
SubProgressMonitor(progressMonitor, 1), dDiagram));


regards,

Florian

On 11/03/2014 03:12, Michael Lukaszczyk wrote:
> Thanks! But could you provide an explanation on how to call this command
> programmatically? I tried it with this (
> http://devblog.virtage.com/2012/09/snippet-of-the-day-execute-eclipse-command-programmatically/
> ) snippet but it says: Trying to execute a command that is not defined.
> org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand.
> I thought that this command is already defined by sirius and I could use
> it out of the box. But this doesn´t seem to be the case. Whats missing?
Previous Topic:Is there a specific extension point for diagram context menu?
Next Topic:Adding inscriptions to edges and using .svg for Node images
Goto Forum:
  


Current Time: Sat Aug 30 10:26:02 EDT 2014

Powered by FUDForum. Page generated in 0.01666 seconds