Bug 170224 - CompositeCommand#reduce() should propogate command label
Summary: CompositeCommand#reduce() should propogate command label
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 1.0.2   Edit
Hardware: All All
: P3 normal
Target Milestone: 1.0.3   Edit
Assignee: Alex Boyko CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-11 10:29 EST by Alex Boyko CLA
Modified: 2010-07-19 12:26 EDT (History)
1 user (show)

See Also:


Attachments
patch (3.45 KB, patch)
2007-01-11 10:47 EST, Alex Boyko CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Boyko CLA 2007-01-11 10:29:48 EST
Although all created commands must have a label, it's not true in practice. Many commands are wrapped inside other commands and hence only the top command and/or the bottom command actually has a non-empty or non-null label. If only the top command has a label CompositeCommand#reduce() may reduce this command to one of it's child or grandchild, hence the resultant command's label is lost. This is the case for "Arrange All" and "Arrange Selection" actions.
1. Open up any GMF example diagram.
2. Put a few shapes on the diagram.
3. Click on "Arrange All" from the tool bar.
4. Open up diagram right-click (context) menu, go to "Edit" -> "Undo"
Problem: menu item for undo should read "Undo Arrange All" (or "Undo Arrange") instead it reads "Undo", because executed command didn't have a label.

There may be other commands that are missing labels, for which CompositeCommand#reduce() will destroy the top command label. Hence, the fix should probably go in CompositeCommand#reduce()#reduce() method to copy the label into resultant reduced command if it didn't have a label.
Comment 1 Alex Boyko CLA 2007-01-11 10:47:32 EST
Created attachment 56774 [details]
patch

Patch planned for 1.0.3
Comment 2 Alex Boyko CLA 2007-01-11 13:44:43 EST
Fixes committed for 1.0.3 and 2.0. Marking as fixed.
Comment 3 Eclipse Webmaster CLA 2010-07-19 12:26:18 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug