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

Bug 344125

Summary: The API should provide a method selectRows(List<EObject> elementsToSelect)
Product: z_Archived Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: EMF-FacetAssignee: Gregoire Dupe <gdupe>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: emft.facet-inbox, gdupe, vincent.lorenzo
Version: unspecifiedFlags: gdupe: indigo+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 343950    
Attachments:
Description Flags
This patch adds the method selectRows to the widget API
gdupe: iplog+, gdupe: review+
The test for the selectRows methods
none
The test for the selectRows methods
gdupe: iplog+, gdupe: review+
Change the behavior of getSelection() + Add a parameter to selectRows
gdupe: review-
Change the behavior of getSelection() + Add a parameter to selectRows gdupe: iplog+, gdupe: review+

Description Vincent Lorenzo CLA 2011-04-28 09:38:40 EDT
The Nattable widget should provide a method selectRows. This method will allow to select a full line, corresponding to an EObject.
It will be useful in order to use "Link with Editor" between the model browser and the Editor.
Comment 1 Vincent Lorenzo CLA 2011-04-28 10:56:36 EDT
Created attachment 194277 [details]
This patch adds the method selectRows to the widget API

(1) I, Vincent Lorenzo, wrote 100% of the code I've provided.
(2) This code contains no cryptography
(3) I have the right to contribute the code to Eclipse.
(4) I contribute the content under the EPL.

The corresponding JUnit Test is coming soon.
Comment 2 Gregoire Dupe CLA 2011-05-02 10:50:57 EDT
Comment on attachment 194277 [details]
This patch adds the method selectRows to the widget API

Here is a patch smaller than 250 lines (117 lines), no CQ are then needed.

I've committed this patch.

Committed revision 600.
Comment 3 Gregoire Dupe CLA 2011-05-02 10:52:12 EDT
A unit test has to be written before to mark this bug as resolved.

Regards,
Gregoire Dupe
Comment 4 Vincent Lorenzo CLA 2011-05-03 10:37:20 EDT
Created attachment 194589 [details]
The test for the selectRows methods

(1) I, Vincent Lorenzo, wrote 100% of the code I've provided.
(2) This code contains no cryptography
(3) I have the right to contribute the code to Eclipse.
(4) I contribute the content under the EPL.
Comment 5 Vincent Lorenzo CLA 2011-05-03 10:39:31 EDT
Created attachment 194591 [details]
The test for the selectRows methods

(1) I, Vincent Lorenzo, wrote 100% of the code I've provided.
(2) This code contains no cryptography
(3) I have the right to contribute the code to Eclipse.
(4) I contribute the content under the EPL.
Comment 6 Vincent Lorenzo CLA 2011-05-03 10:44:00 EDT
Created attachment 194592 [details]
Change the behavior of getSelection() + Add a parameter to selectRows

(1) I, Vincent Lorenzo, wrote 100% of the code I've provided.
(2) This code contains no cryptography
(3) I have the right to contribute the code to Eclipse.
(4) I contribute the content under the EPL.

In this new patch : 
   getSelection returns the element represented by the line when the fully line is selected
   selectRows(List<EObject> objectsToSelect, boolean clearTheSelection).
The second parameters is useful for the JUnit test : it allows to test the function getSelection when a line + a cell are selected.
Comment 7 Gregoire Dupe CLA 2011-05-05 12:41:30 EDT
Comment on attachment 194592 [details]
Change the behavior of getSelection() + Add a parameter to selectRows

Hello Vincent,

Please, don't format the lines you haven’t modified.

Otherwise, it’s ok for me.

Regards,
Gregoire Dupe
Comment 8 Vincent Lorenzo CLA 2011-05-06 03:18:25 EDT
Created attachment 194905 [details]
Change the behavior of getSelection() + Add a parameter to selectRows

Hello Grégoire, I'm sorry for the format. 
This is the same same patch without the format action!

(1) I, Vincent Lorenzo, wrote 100% of the code I've provided.
(2) This code contains no cryptography
(3) I have the right to contribute the code to Eclipse.
(4) I contribute the content under the EPL.

Regards, 
-- 
Vincent Lorenzo
Comment 9 Gregoire Dupe CLA 2011-05-06 04:51:20 EDT
Comment on attachment 194591 [details]
The test for the selectRows methods

Here is a patch smaller than 250 line (76 lines), no CQ is then needed.

I've commited this patch.

Committed revision 633.
Comment 10 Gregoire Dupe CLA 2011-05-06 04:52:30 EDT
Comment on attachment 194905 [details]
Change the behavior of getSelection() + Add a parameter to selectRows

Here is a patch smaller than 250 line (115 lines), no CQ is then needed.

I've commited this patch.

Committed revision 633.
Comment 11 Gregoire Dupe CLA 2011-05-06 04:54:03 EDT
This bug can be marked as fixed.
Comment 12 Gregoire Dupe CLA 2011-05-06 08:15:40 EDT
The committed patches may cause a regression: The unit test "org.eclipse.emf.facet.widgets.nattable.tests.NatTableHandlersTests.selectionTest " fails.
Comment 13 Gregoire Dupe CLA 2011-05-06 09:45:12 EDT
The test "selectionTest" has to be modified because the behavior of INatTableWidget.getSelection() has been changed by the patch (attachment 194905 [details]).

I've committed a fix. (Committed revision 634.)
Comment 14 Gregoire Dupe CLA 2011-05-09 09:51:35 EDT
Hello,

All unit tests succeed in the build https://hudson.eclipse.org/hudson/job/emffacet-nightly/299/.

We can then mark this bug as resolved.

Regards,
Gregoire Dupe
Comment 15 Vincent Lorenzo CLA 2011-05-10 03:40:52 EDT
This bug can be marked as closed.