| Summary: | [Grid] Dynamic Footer Text (e.g. aggregates) [with patch] | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Hannes Erven <hannes> | ||||
| Component: | Nebula | Assignee: | Thomas Schindl <tom.schindl> | ||||
| Status: | CLOSED INVALID | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | cgross, sharonbsnyder | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Hannes Erven
Created attachment 186000 [details]
Suggested patch (work-in-progress I guess)
Overloading refresh() is not enough because one can also modify things using add, remove - I also think setFilter(), addFilter() is not going through refresh() as well as sorting. I'll try to take a look at this and give you much more qualified feedback when I had a closer look. The filter operations (addFilter, setFilter, ...) all do explicitly call refresh() in any case. Ordering should not have an impact on the calculated aggregates. add()/remove() do indeed not call refresh(). Thank you for looking into this! Not for aggregation but probably other functions which operate on the order of things. I admit I have not read the comments or the patch code submitted. I just wanted to put my $0.02 in. I do aggregation on my GridTreeViewer - but I base it on data from the column that tells me to total it or not, how to format it, and if I have selected rows I only total those records, vs. all the records if none are selected. I'm sure what I've done can be integrated (to some degree) with an API to make it easier for me (i.e. recalculateFooter(IStructuredSelection) override and ability to set column totaling information - $$ amounts, percent calculations, quantity (# of units) - note they have different formatting requirements....and the ability to do this based on content and selection changes). If you'd like more info on what I did, I'll be happy to provide you with the info and my thoughts on what might help in terms of a common API that can be used by others. While something would be great to have built in, don't remove the ability for us to "roll our own" if the one you provide doesn't "do it" for us please! In preparation for the upcoming transition to Mars, I've ported my patch to the current head. For now, I'll be maintaining my changes at my Github Fork: https://github.com/hannibal218bc/rap/tree/_hannibal218bc The changeset is not yet fully tested. In short, the base idea is to override refresh(Element) and update the footer texts. Sharon, I'd be still interested to hear how you solved that. With the current public API of the GridTreeViewer, I don't really see how an automatic calculation could be implemented? The ContentProvider has no way of knowing what items are currently displayed, the Filter has no way of receiving updates; the only way would be to add a change listener to the ContentProvider, filter the elements once more and update the footers then? I left that job a couple of years ago and, unfortunately, have not been working with Eclipse much. However from what I remember of what I did, I added some data to the column definition that would tell me that a column was to be summed, averaged, displayed as a percentage, dollar amount, etc. Sorry - but that is about all I remember. This bug does not have a target milestone assigned and is automatically closed as part of the 2.3.0 release cleanup. It could be that this bug is accidentally closed for which we apologize. If this bug is still relevant, please re-open and set a target milestone. |