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

Bug 366367

Summary: To be able to change the "CanBePresentedInTheTable" query
Product: z_Archived Reporter: Gregoire Dupe <gdupe>
Component: EMF-FacetAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: emft.facet-inbox, vincent.lorenzo
Version: unspecifiedFlags: gdupe: juno+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 369117, 367335, 367341    
Bug Blocks:    
Attachments:
Description Flags
patch
none
resources
nicolas.bros: iplog+
modified files
none
patch v2
none
modified files v2
none
patch v3
none
modified files v3
none
selectPresentabilityQueryButton.png
nicolas.bros: iplog+
patch for Table v2
none
patch v2 for table v2
none
patch v3 for table v2 nicolas.bros: iplog+

Description Gregoire Dupe CLA 2011-12-12 05:05:13 EST
It would be useful to be able to change the "CanBePresentedInTheTable" query during the execution.

A canBePresentedInTheTable query presented query is used to now if a model element can be presented in the table. For instance, this query is to know if the table must accept a model element form a drag and drop.

If model elements already presented in the table are not conform to the new canBePresentedInTheTable query, then the user will have to choose if he wants to remove them from the table.
Comment 1 Gregoire Dupe CLA 2011-12-12 05:14:10 EST
I’ve committed a new version of the INatTableWidget interface. This new interface contains the methods which have to be implemented to satisfy this enhancement.

Committed revision 1264.
Comment 2 Gregoire Dupe CLA 2011-12-13 05:27:08 EST
I’ve committed the interfaces which must be used to implement the GUI dialogs needed to select a “canBePresentedInTheTable” query.

I’ve also committed a partially implemented unit test to illustrate the use of the dialogs.

Committed revision 1267.
Comment 3 Gregoire Dupe CLA 2011-12-13 05:28:01 EST
(In reply to comment #2)
> I’ve also committed a partially implemented unit test to illustrate the use of
> the dialogs.

Cf. org.eclipse.emf.facet.widgets.nattable.tests.internal.CanBePresentedInTheTableDialogTest
Comment 4 Nicolas Bros CLA 2011-12-20 11:21:34 EST
Created attachment 208630 [details]
patch

Here is a patch that implements the functionality and unit tests, with dialogs designed to be testable with pure JUnit tests.
Comment 5 Nicolas Bros CLA 2011-12-20 11:23:44 EST
Created attachment 208632 [details]
resources

Here are the accompanying images.
Comment 6 Nicolas Bros CLA 2011-12-21 05:07:11 EST
Created attachment 208665 [details]
modified files

There seems to be a bug that prevents the patch from being applied properly. So, here are the modified files in a zip: you can unzip it at the root of your workspace, replacing the previous files.
Comment 7 Nicolas Bros CLA 2011-12-21 06:24:16 EST
Created attachment 208669 [details]
patch v2

Here is an updated patch that adds the possibility to reset the presentability query through a checkbox on the query selection dialog.
Comment 8 Nicolas Bros CLA 2011-12-21 06:26:57 EST
Created attachment 208670 [details]
modified files v2

And since I suspect that this patch won't want to apply cleanly either, here are the modified files.
Comment 9 Nicolas Bros CLA 2011-12-21 09:01:03 EST
Created attachment 208677 [details]
patch v3

In this patch, I added unit tests to check that undo-redo can be used after changing a presentability query, and I externalized a UI string.
Comment 10 Nicolas Bros CLA 2011-12-21 09:02:05 EST
Created attachment 208678 [details]
modified files v3

The corresponding zip of modified files.
Comment 11 Nicolas Bros CLA 2011-12-21 10:04:15 EST
Created attachment 208681 [details]
selectPresentabilityQueryButton.png

Here is a cleaned up version of a screenshot of the presentability query button in the toolbar, without the Facet icons that shouldn't be there.

org.eclipse.emf.facet.widgets.nattable.doc/selectPresentabilityQueryButton.png
Comment 12 Nicolas Bros CLA 2012-01-20 11:26:09 EST
Created attachment 209837 [details]
patch for Table v2

I have adapted the patch for the Table v2.
Comment 13 Nicolas Bros CLA 2012-01-23 08:12:51 EST
Created attachment 209907 [details]
patch v2 for table v2

Here is a new version of the patch. I cleaned up some code, added missing copyrights and externalized strings.
Comment 14 Nicolas Bros CLA 2012-01-24 08:41:39 EST
Created attachment 209967 [details]
patch v3 for table v2

Here is a new cleaned up version of the patch.
Comment 15 Nicolas Bros CLA 2012-02-01 11:58:05 EST
Committed in revision 1560.
Comment 16 Gregoire Dupe CLA 2012-05-23 08:58:34 EDT
This bug can be closed.