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

Bug 208700

Summary: AbstractTool should use CommandStackEventListener
Product: [Tools] GEF Reporter: Pratik Shah <ppshah>
Component: GEF-Legacy GEF (MVC)Assignee: Pratik Shah <ppshah>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: 3.4.0 (Ganymede) M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Pratik Shah CLA 2007-11-04 11:43:37 EST
AbstractTool listens to the command stack using the old CommandStackListener interface.  If you change it to listen to the new CommandStackEventListener, it would get notified before the stack changes and hence can clean-up properly.

This should be a simple, safe fix that would only require that the private listener be changed from a CommandStackListener to a CommandStackEventListener.
Comment 1 Pratik Shah CLA 2007-11-04 11:48:31 EST
Also, handleCommandStackChanged() should check for invalid state before it invokes handleInvalidInput() (currently, it only checks for initial state).
Comment 2 Pratik Shah CLA 2008-01-14 17:22:58 EST
Fixed.  AbstractTool now becomes invalid before the command stack changes (instead of after).