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

Bug 237846

Summary: Add possibility to add a control to the head of a column
Product: z_Archived Reporter: Thomas Schindl <tom.schindl>
Component: NebulaAssignee: Chris Gross <cgross>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Flags: tom.schindl: review? (cgross)
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Work ontop of the original one
none
Fix to recalculate the header appropiately after a control has been set
none
Minimize Patch-Size
wim.jongman: iplog+, wim.jongman: review-
Fix sorter location wim.jongman: iplog+, wim.jongman: review-

Description Thomas Schindl CLA 2008-06-19 16:35:15 EDT
Bug 166089 discusses how to provide the possibility to add support for fixed row and footer. In this context Sergey Stepanenko brought up the idea to add a control to the header.
Comment 1 Thomas Schindl CLA 2008-06-19 16:39:01 EDT
Created attachment 105448 [details]
Work ontop of the original one

I've take the idea from Sergey Stepanenko and reworked it to have a better API. There are still some corner cases (at least on OS-X the second column is not rendered appropiately when SWT.BORDER is used)
Comment 2 Thomas Schindl CLA 2008-06-19 17:11:28 EDT
Created attachment 105452 [details]
Fix to recalculate the header appropiately after a control has been set
Comment 3 Thomas Schindl CLA 2008-06-23 10:20:51 EDT
Created attachment 105637 [details]
Minimize Patch-Size
Comment 4 Thomas Schindl CLA 2008-06-23 10:21:23 EDT
Marking for review by Chris
Comment 5 Chris Gross CLA 2008-06-25 13:28:43 EDT
Thoughts:

Need comments everywhere.  Specifically better comments on the public facing methods (or methods that will be implemented by others).  At first glance, its not obvious what a 'header control' would be used for.  Should point out that its typically used for filtering.

The GridHeaderEditor class seems to only be used internally. A user doesn't instantiate this class as we normally would with other editors.  So I would make that an internal class.  Also needs to be commented and given the EPL header.

Other than those small comments I think this looks good.
Comment 6 Chris Gross CLA 2008-06-25 13:29:13 EDT
Oh and I would add a separate snippet for it (I think this is important for all new features).
Comment 7 Thomas Schindl CLA 2008-06-25 13:35:20 EDT
Chris, I'm always doing the comment work before commit but its simply too much of work while the API is in flux. 

Rest assured that all public API will get the desired. GridHeaderEditor is at the public package because then it can access package-scoped methods on the Grid (the newly added method there is recalculateHeader() which has to get API if I move the class to internal) but it doesn't count as public-API because the class and its constructor are package-scoped.
Comment 8 Thomas Schindl CLA 2008-06-25 13:37:04 EDT
here too it will get a seperate one of course I do the same when coding JFace take a snippet already there play with the implementation and ... .

(In reply to comment #6)
> Oh and I would add a separate snippet for it (I think this is important for all
> new features).
> 

Comment 9 Chris Gross CLA 2008-06-25 13:59:35 EDT
Hmm....  The package access/GridHeaderEditor thing is interesting.  I really think we ought to do something so users don't get confused over this class.  I think I would rather see the recalculateHeader method go public (and be called internal_recalculateHeader with warnings in the comments).  I'd rather have one public method we don't want than a whole class we don't want public.

Re comments - yea I figured as much but I'm always one to bug when I don't see javadoc completed ;)
Comment 10 Thomas Schindl CLA 2008-06-25 14:05:16 EDT
Chris, the class is *not* public and can't get subclassed/reached because it is package scoped, so JDT will not even let you import it whether you want or not.

The real solution to this problem is that we should move the Grid-Implementation to internals and at the surface provide the public API. I see the potential that the more features we'll add the more internal_* we would get.
Comment 11 Chris Gross CLA 2008-06-25 14:11:47 EDT
Ah I see.  I didn't notice that it wasn't public.  Should have looked.

Re the bigger question of moving to a separate class for internals - yes that would be good but also would increase the complexity of the code.  I am hestitant to anything that increases the complexity of the code at this point.  So I would hold off on doing this.

Comment 12 Thomas Schindl CLA 2008-06-25 14:14:33 EDT
That's what I also thought but for now I could get away with leaving it the way it is and with the current solution we have as less API as possible.
Comment 13 Chris Gross CLA 2008-06-25 14:20:46 EDT
Yup.  Agreed.
Comment 14 Thomas Schindl CLA 2008-06-26 09:41:54 EDT
Created attachment 105902 [details]
Fix sorter location
Comment 15 Thomas Schindl CLA 2008-09-06 18:18:23 EDT
released to CVS header_footer >= 20080907