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

Bug 361985

Summary: ITable: more flexibility to discard deleted rows in tables
Product: z_Archived Reporter: Jeremie Bresson <dev>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: dev, zimmermann
Version: unspecifiedFlags: zimmermann: juno+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch for bug 361985
none
Patch for bug 361985 (v2)
stephan.leichtvogt: iplog+
Test for Bug 361985 stephan.leichtvogt: iplog+

Description Jeremie Bresson CLA 2011-10-25 14:03:55 EDT
Build Identifier: 

Bug following the discussion here:
http://www.eclipse.org/forums/index.php/t/210744/

* Naming consistency:
clearDeletedRows() => discardAllDeletedRows()


* Add the possibility to discard a specific deleted row
discardDeleteRow(TableRow deletedRow)
discardDeleteRows(TableRow deletedRow)

discarding a DeletedRow by index (or array of indexes) makes no sense, because if the row is deleted, the row do not have an index anymore.

Reproducible: Always
Comment 1 Jeremie Bresson CLA 2011-12-31 04:38:46 EST
Created attachment 208888 [details]
Patch for bug 361985

Patch that implements the proposed modifications.

new methods:
- discardAllDeletedRows();
- discardDeletedRow(ITableRow deletedRow);
- discardDeletedRows(ITableRow[] deletedRows);

deprecated:
- clearDeletedRows() [use discardAllDeletedRows() instead]



MIGRATION:
ITable#clearDeletedRows() is deprecated, use ITable#discardAllDeletedRows() instead.



How can I test this modification (and write a test) to ensure that the methods work as expected ?
Comment 2 Jeremie Bresson CLA 2012-01-04 15:18:20 EST
Created attachment 209033 [details]
Patch for bug 361985 (v2)

Patch for bug 361985. Version 2.

Fix a NPE: 
call setTableInternal(null)
after getRowKeys(row)
Comment 3 Jeremie Bresson CLA 2012-01-04 15:24:19 EST
Created attachment 209034 [details]
Test for Bug 361985

Test for this bug.

To run this class with JUnit, a test infrastructure as described in [1] is needed.
This is not a plain JUnit test, because the Scout Runtime/Equinox need to be started.

[1] http://www.eclipse.org/forums/index.php/mv/msg/262115/757087/#msg_757087
Comment 4 Stephan Leicht Vogt CLA 2012-04-10 03:42:16 EDT
Patch slightly modified and applied on trunk for Juno.
Thank you Jeremie.
Comment 5 Matthias Zimmermann CLA 2012-07-09 06:50:39 EDT
ticket closed.
deliverd as part of eclipse scout 3.8.0 (juno release train)