Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » The diagramUpdateFeature ignores isAutoUpdateAtRuntime
The diagramUpdateFeature ignores isAutoUpdateAtRuntime [message #1244414] Wed, 12 February 2014 09:47 Go to next message
Jochen Buchholz is currently offline Jochen BuchholzFriend
Messages: 6
Registered: November 2013
Junior Member
Hi all,
I develop a multipage editor like the example in the graphiti integration test org.eclipse.praphiti.testtool.sketch. The Editor has two subpannels, one with an JFace/Forms pannel and a second sub pannel with a graphiti editor. I extended the DefaultUpdateDiagramFeature and it works very well, but not automatically like the normal update feature ( isAutoUpdateAtRuntime seems to be ignored ). I must right click on a free place on the diagram and select update.

The job of my custom diagramUpdateFeature is to detect new business objects, added in the jface/forms panel and paint them to the left site in the diagram.

The eclipse forms multi editor calls a method panelChange when I switch to the graphiti editor pannel. Is there a propper way to fire a diagram update event?

thanks in advance

Jochen
Re: The diagramUpdateFeature ignores isAutoUpdateAtRuntime [message #1245901 is a reply to message #1244414] Fri, 14 February 2014 12:30 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1927
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Jochen,

not sure what is causing the update not to happen: the
DomainModelChangeListener triggers the diagram update but only in case the
diagram container (the editor) is not dirty. Maybe the editor is dirty?

You can manually trigger the update by calling refresh() on the
DiagramBehavior instance (if you have the DiagramEditor only,
editor.getDiagramBehavior().refresh()).

Michael
Re: The diagramUpdateFeature ignores isAutoUpdateAtRuntime [message #1248797 is a reply to message #1245901] Mon, 17 February 2014 17:19 Go to previous messageGo to next message
Jochen Buchholz is currently offline Jochen BuchholzFriend
Messages: 6
Registered: November 2013
Junior Member
Hi Michael,
when I did a change in the JFace editor panel on my model the editor is dirty, because I did a change. When I call refresh in the DiagramBehaviour my exetended DefaultUpdateDiagramFeature isn't called. I added my exetended DefaultUpdateDiagramFeature in the feature provider.

The only way to start my exetended DefaultUpdateDiagramFeature is a right click on the blank diagram area and select update in the popup menu.

Jochen
Re: The diagramUpdateFeature ignores isAutoUpdateAtRuntime [message #1249605 is a reply to message #1248797] Tue, 18 February 2014 12:28 Go to previous message
Jochen Buchholz is currently offline Jochen BuchholzFriend
Messages: 6
Registered: November 2013
Junior Member
I found a solution. I trigger my DiagramUpdateFeature in the pageChanged method like the following:
if (newPageIndex == 1 && typeDiagramEditor != null) {
  typeDiagramEditor.updateDirtyState();
  if(typeDiagramBehavior!=null){
    UpdateContext updateContext =
      new UpdateContext(typeDiagramEditor.getDiagramBehavior()
          .getDiagramTypeProvider().getDiagram());
    typeDiagramEditor.getDiagramTypeProvider()
                     .getFeatureProvider()
                     .updateIfPossible(updateContext);
}

now my DiagramUpdateFeature is called after a pagechange in the multipage FormEditor
Previous Topic:Issues opening the correct diagram
Next Topic:Anchor covers figure
Goto Forum:
  


Current Time: Fri Jun 18 10:02:06 GMT 2021

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

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

Back to the top