Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Undo and Redo Support #1182

Closed
9 tasks done
philip-alldredge opened this issue Apr 25, 2018 · 2 comments
Closed
9 tasks done

Improve Undo and Redo Support #1182

philip-alldredge opened this issue Apr 25, 2018 · 2 comments

Comments

@philip-alldredge
Copy link
Collaborator

philip-alldredge commented Apr 25, 2018

support for undoing and redoing actions.

Undo and redo support is currently very limited. It needs to be expanded to fix issues with the dirty state indicator and to allow undoing any operation as long the text editor isn't being used. If the text editor is being used, then undo support will be reduced.

  • An undo stack which is shared across editors should be implemented.
  • Undoing or redoing an action will result in the appropriate editor being activated.
  • Changes to diagram configuration should be undoable.
  • The undo stack should include diagram changes and model changes from the graphical editor including the properties view. Model changes along with any associated diagram changes should be represented as a single entry on the undo stack.
  • Updates that do not affect any diagram and were not caused by the graphical editor should not be shown in the undo stack.
  • Model updates outside the graphical editor should reset the action stack. This includes updates caused by opening and closing the AADL source.
  • Renaming should be undoable.
  • Diagram should be dirty if and only if there was a visual change to the diagram itself.
  • Undoing an operation that caused the diagram to be dirty should result in the diagram no longer being dirty.

Also include #1199

@philip-alldredge
Copy link
Collaborator Author

philip-alldredge commented Jun 6, 2018

Rationale

Global Undo

A shared undo/redo strategy was chosen because multiple diagrams may be interacting with the same AADL packages. In such cases, actions must be reversed in the order they were performed.

Text Editor Limitations

Undo and redo behavior will be degraded when the text editor is open due to implementation challenges. The text documents have their own undo stacks. When the graphical editor edits such a model, the change is added to the document's stack.
While invalidating the undo stack when the text editor is opened or used is sub-optimal, it is imagined that in most cases a user will want to undo changes immediately after performing them rather than after opening the text editor. With the text editor open the behavior will be similar to the current behavior but when it is closed, the undo behavior will be significantly enhanced by allowing reversing of model changes.

@ghost ghost added in progress and removed next labels Jun 8, 2018
philip-alldredge added a commit that referenced this issue Jun 19, 2018
Implements #1182, #1199, and #1246.

Replaces the current undo capability that is is
very limited with an implementation that allow undoing and redoing a
wider range of actions. Usage of the text editor can degrade
capabilities.

- Removed implementation of ICustomUndoRedoFeature. Graphiti undo/redo
no longer needed
- Removed ability to disable Graphiti modification listener. No longer
necessary with new undo implementation.
- Added undo support for add/remove element
- Added undo support for ghosting
- Added undo support for setDiagramConfiguration
- Added ActionService, AgeAction, and ActionExecutor
- Implemented global undo/redo stacks.
- Reworked interface between AgeDiagram, GraphitiAgeDiagram, and
AgeDiagramEditor to use AgeAction interface.
- Undo/Redo actions for an editor are invalidated if the editor is
closed.
- Implemented switching to appropriate editor when undo/redo occurs.
- Implemented Undo/Redo of model changes.
- Updates DiagramExporterTest based on changes needed for the new action
system and to fail on exception.
- Added test for dirty state indicator.
philip-alldredge added a commit that referenced this issue Jun 19, 2018
* Undo/Redo rework.

Implements #1182, #1199, and #1246.

Replaces the current undo capability that is is
very limited with an implementation that allow undoing and redoing a
wider range of actions. Usage of the text editor can degrade
capabilities.

- Removed implementation of ICustomUndoRedoFeature. Graphiti undo/redo
no longer needed
- Removed ability to disable Graphiti modification listener. No longer
necessary with new undo implementation.
- Added undo support for add/remove element
- Added undo support for ghosting
- Added undo support for setDiagramConfiguration
- Added ActionService, AgeAction, and ActionExecutor
- Implemented global undo/redo stacks.
- Reworked interface between AgeDiagram, GraphitiAgeDiagram, and
AgeDiagramEditor to use AgeAction interface.
- Undo/Redo actions for an editor are invalidated if the editor is
closed.
- Implemented switching to appropriate editor when undo/redo occurs.
- Implemented Undo/Redo of model changes.
- Updates DiagramExporterTest based on changes needed for the new action
system and to fail on exception.
- Added test for dirty state indicator.

* Removed print statements from tests.

* Activate editor on undo fixes.
@philip-alldredge
Copy link
Collaborator Author

philip-alldredge commented Jun 19, 2018

Fixed in ebd75e1

@ghost ghost removed the in progress label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant