Force refresh not working for me [message #1254927] |
Sun, 23 February 2014 19:18  |
Eclipse User |
|
|
|
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 #1268990 is a reply to message #1268807] |
Tue, 11 March 2014 04:40  |
Eclipse User |
|
|
|
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?
|
|
|
Powered by
FUDForum. Page generated in 0.07006 seconds