Bug 98565 - hookListeners() and unhookListeners() in DirectEditManager should have protected visibility
Summary: hookListeners() and unhookListeners() in DirectEditManager should have protec...
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.0 (Ganymede) M2   Edit
Assignee: Cherie Revells CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-06-06 14:18 EDT by Jon H CLA
Modified: 2008-09-18 13:30 EDT (History)
2 users (show)

See Also:


Attachments
reveals API (1.19 KB, patch)
2007-09-06 10:39 EDT, Cherie Revells CLA
no flags Details | Diff
Final patch (1.60 KB, patch)
2007-09-19 11:13 EDT, Cherie Revells CLA
ahunter.eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon H CLA 2005-06-06 14:18:36 EDT
This task is marked as TODO and may have been overlooked. There is no way to 
customize the way a CellEditor exits edit mode since the hookListeners() 
method cannot be overriden.
Comment 1 Randy Hudson CLA 2005-06-06 14:32:53 EDT
What is it that you want to do differently?  Maybe we can add that case rather 
than open up new API.
Comment 2 Pratik Shah CLA 2005-06-09 15:44:39 EDT
Reducing severity to normal.
Comment 3 Cherie Revells CLA 2007-09-06 10:39:45 EDT
Created attachment 77815 [details]
reveals API

I want to add a new listener in the DirectEditManager.  The method unhookListeners() is already protected, but hookListeners() isn't.  

I would also like access to the locator.  It is passed into the constructor so I see no reason to not make the getLocator() method protected.
Comment 4 Randy Hudson CLA 2007-09-06 11:57:36 EDT
What's the reason to access the locator rather than the method placeCellEditor()? Just asking because maybe the reason is related to another open bug aboue the fact that the locator is invoked twice for every character when typing into a Text control.
Comment 5 Cherie Revells CLA 2007-09-06 13:16:06 EDT
Actually, if the method placeCellEditor() is changed to protected that would be sufficient.

There are two cases where we need access to the locator or the placeCellEditor() call.
  
1) There is currently a case in our code where we have to relocate the cell locator so we are caching the locator in our subclass as well to have access to it.  I don't know the history of this change.  

2) With the changes I am making to use the flow figure classes in our label figures, the cell locator's size is based on the FlowPage figure bounds; however, in DirectEditManager.hookListeners() the AncestorListener is added to the editpart's figure which is the label figure (parent of the FlowPage) and not the FlowPage figure.  
Comment 6 Randy Hudson CLA 2007-09-06 17:03:18 EDT
> 2) ... in DirectEditManager.hookListeners() the AncestorListener is added to
> the editpart's figure ...

Sounds like the manager should allow clients to specify which figure the locator is actually tracking, rather than assuming that it is the primary figure.
Comment 7 Cherie Revells CLA 2007-09-19 11:13:13 EDT
Created attachment 78758 [details]
Final patch

Updated patch that has been reviewed by Anthony.
Comment 8 Anthony Hunter CLA 2007-09-19 13:53:12 EDT
Committed to HEAD