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

Bug 255583

Summary: [Command] Make the CommandStack fields protected
Product: [Tools] GEF Reporter: Pratik Shah <ppshah>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse, hudsonr, nyssen
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Pratik Shah CLA 2008-11-17 21:38:27 EST
The GEF CommandStack class has several private fields.  It's not unusual to want to customize the CommandStack class, and access to these fields can be needed.  In our case, we've made our command stack support appendable commands, ie, after a command has been executed, it may do additional things.  To get the dirty state to be reflected properly, we need access to the saveLocation field.
Comment 1 Randy Hudson CLA 2008-11-18 09:29:51 EST
One reason to not expose the field is to allow a CommandStack subclass to delegate to the IOperationHistory, in which case the private fields aren't even used. Maybe we could provide API that parallels the IOperationHistory API, like Command[] getUndoHistory().

Do you have a case where you continue appending an executed command right after save has occurred?  This wouldn't be consistent with Office. The user should always be able to undo/redo to the saved state, rather than skipping past it.
Comment 2 Anthony Hunter CLA 2008-11-18 10:37:06 EST
This is probably a duplicate of Bug 39386
Comment 3 Alexander Nyßen CLA 2011-01-08 11:25:03 EST
Exposing the field would - as Randy has already