Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 421411

Summary: [Diagram] Navigating a hyperlink marks the model as dirty.
Product: [Modeling] Papyrus Reporter: Toni Siljamäki <toni.siljamaki>
Component: DiagramAssignee: Christian Damus <give.a.damus>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cletavernier, papyrus-bugs
Version: 1.0.0   
Target Milestone: M7   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 394775, 429239    

Description Toni Siljamäki CLA 2013-11-10 11:21:23 EST
Unmodified models shall never ve updated.
Comment 1 Toni Siljamäki CLA 2013-11-10 11:22:49 EST
Unmodified models shall never be updated.
Comment 2 Camille Letavernier CLA 2013-11-12 09:05:27 EST
Opening/closing a diagram marks the model as dirty. It doesn't matter how you do it (Opening/closing from model explorer, closing from the editor, navigating an hyperlink, ...)

This issue is already identified in Bug 400809 and Bug 394775

*** This bug has been marked as a duplicate of bug 400809 ***
Comment 3 Toni Siljamäki CLA 2013-11-14 11:30:26 EST
No, this is a different issue - I was not clear enough:

Swithching to an already open diagram does not mark the model as dirty.
It did before, as described by bug 394775, but this is not the case now.

But...
Navigating a hyperlink to an already open diagram do mark the model as dirty.
Comment 4 Camille Letavernier CLA 2014-03-11 11:08:13 EDT
Fixed (Details in Bug 429239)
Comment 5 Toni Siljamäki CLA 2014-03-11 15:07:06 EDT
Sorry Camille.
Navigating a hyperlink to a diagram in a different model
marks the model as "touched". (the model I demo'ed today)
Comment 6 Christian Damus CLA 2014-03-25 11:30:11 EDT
Per off-line discussion with Camille, I'll have a go at this.
Comment 7 Christian Damus CLA 2014-03-25 11:45:48 EDT
(In reply to Toni Siljamäki from comment #5)
> Sorry Camille.
> Navigating a hyperlink to a diagram in a different model
> marks the model as "touched". (the model I demo'ed today)

I'm not seeing this on today's Git master commit 765fd9a.

I have a model A with a diagram a containing a link to a diagram b in model B, which diagram b is not open.  I click the link and diagram b opens and is activated; the editor is not dirty.

(note that there is only the one editor for model A because model B is opened as a "library model" in the Model Explorer)

Toni, are there specific steps that produce the follow-up problem that you reported?
Comment 8 Camille Letavernier CLA 2014-03-25 12:01:29 EDT
Apparently, only the Double-click (To navigate default hyperlinks) introduces this behavior, because it is implemented as an OpenRequest (Which is transformed to a GMF ICommand and executed in the DiagramCommandStack). The Hyperlink navigation through the tooltip bypasses the request framework/DiagramCommandStack.

Steps to reproduce:

- Drop a (closed) Diagram on an element in a Diagram (To create a default hyperlink)
- Double click on the element (To navigate the Hyperlink)
Comment 9 Christian Damus CLA 2014-03-25 12:04:33 EDT
Ah!  Thanks, I didn't know you could double-click.  Confirmed.
Comment 10 Christian Damus CLA 2014-03-25 13:00:38 EDT
Fixed on Git master, commit 31d598f.

As the commands that are executed to navigate a hyperlink do not dirty the model (in the abstract sense), they are now marked as non-dirtying so that the dirty state calculation may correctly account for them.
Comment 11 Toni Siljamäki CLA 2014-03-28 10:48:49 EDT
Tested on 1.0.0.v201403272326 and it works. :)
= model is not marked as touched when navigating to a different diagram.