| Summary: | DragEditPartsTracker forgets to unwrap created CompoundCommand | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Mathieu Veurman <mveurman> |
| Component: | GEF-Legacy GEF (MVC) | Assignee: | Alexander Nyßen <nyssen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | trivial | ||
| Priority: | P3 | CC: | ahunter.eclipse, mromijn, mveurman, nyssen |
| Version: | 3.5 | ||
| Target Milestone: | 3.6.0 (Helios) M7 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Changes committed to cvs HEAD. Do not forget to update the copyright header to 2010 to indicate a change made in 2010. Done. |
Build ID: I20090611-1540 The method getCommand() in org.eclipse.gef.tools.DragEditPartsTracker creates a CompoundCommand, but forgets to call unwrap() on it before returning it. We're supplying a view to our end users that lists the current command stack to the user in a tree. Some MOVE commands that are a result of the DragEditPartsTracker are CompoundCommands with just 1 command in them. unwrap() normally would return the simplest form that is equivalent, and removes this unnecessary nesting. The change is very easy. Change the last statement of getCommand() from return command; into return command.unwrap(); Workaround: There is a workaround by overriding getDragTracker(Request request) in every edit part you have: @Override public DragTracker getDragTracker(Request request) { return new org.eclipse.gef.tools.DragEditPartsTracker(this) { @Override protected Command getCommand() { Command command = super.getCommand(); if (command instanceof CompoundCommand) { return ((CompoundCommand)command).unwrap(); } return command; } }; }