| Summary: | Using autoUpdateAtStartup, even editors with unchanged contents are set dirty | ||
|---|---|---|---|
| Product: | [Modeling] Graphiti | Reporter: | Joerg Reichert <joerg83reichert> |
| Component: | Core | Assignee: | Michael Wenz <michael.wenz> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | matthias.gorning, michael.wenz, refsdal.ivar |
| Version: | 0.8.0 | Flags: | michael.wenz:
juno+
|
| Target Milestone: | 0.9.0 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | Juno M2 Theme_bugs | ||
Unfortunately changing the update method does not help, as its result is not evaluated. Now I think it is because the method DefaultUpdateDiagramFeature.updateNeeded is never called. Anyhow it must be prevented that the update command is added to the undoable command when no update has been performed. Additional idea: Maybe also the feature could be queried using hasDoneChanges() There were two issues involved here: 1) DefaultUpdateDiagramFeature did not correctly deliever the result for hasDoneChanges() (actually always returned true). 2) The update at startup was triggered using the inner EMF command stack, but the editor shows the state of the outer GMF command stack. Commands done inside an editor must always be performed on the outer command stack the editor uses. This gap also existed for some other calls done from AbstractFeatureProvider and the context menu entries. Both bugs are fixed in head, JUnit tests for 1) and an SWTBot test for 2) was added: commit 17f492ad5b4c29d17d08c2f0a5b865c866e47c29 Author: mwenz <michael.wenz@sap.com> 2011-09-15 14:51:30 Committer: mwenz <michael.wenz@sap.com> 2011-09-15 14:51:30 Parent: ed8ee24b86eca067d7a446f3475a2689bd7b3bf2 (Bug 355401 - Problem with printers: Slow speed/performance when selecting/de-selecting nodes) Branches: origin/master, master *** Bug 358822 has been marked as a duplicate of this bug. *** Bookkeeping: Set target release Part of Graphiti 0.9.0 (Eclipse Juno) |
Build Identifier: Eclipse 3.7 (20110615-0604), Graphiti 0.8.0.v20110607-1252 Context: I want the diagram editor to apply changes in the domain model done outside the diagram editor when editor is opened. Therefore I have overriden @Override public boolean isAutoUpdateAtStartup() { return true; } in my diagram type provider class. But now even there has been no changes made to the domain model the editor is marked as dirty. I digged into Graphiti's sources to find out, that the editor is set to dirty if there were undoable commands collected. I further found out, that the DefaultUpdateDiagramFeature is executed and that its update method cascades calls to the update features belonging to its contained shapes. Currently DefaultUpdateDiagramFeature.update always returns true. I think the results of the update method calls of the contained shapes should be aggregated instead: @Override public boolean update(IUpdateContext context) { boolean updatePerformed = false; PictogramElement pe = context.getPictogramElement(); if (pe instanceof Diagram) { ... for (IUpdateFeature feature : connToUpdate.keySet()) { updatePerformed |= feature.update(connToUpdate.get(feature)); } } return updatePerformed; } But I'm not sure if this would fix this bug. Reproducible: Always