Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Custom persistence behavior and modifying the PersistenceDialog
Custom persistence behavior and modifying the PersistenceDialog [message #1784563] Thu, 29 March 2018 11:30 Go to next message
Alexander Farel is currently offline Alexander FarelFriend
Messages: 4
Registered: March 2018
Junior Member

Let me begin by describing the following scenario where we use Nattable.

We want to provide mass edition capabilities for our users, so basically users drag and drop elements in a view and depending on some features of the dropped elements - we construct a table having as many columns as editable features.

If new elements that don't share all the features with all the existing ones in our table are added, we change the table's structure and we display only their common features. We do this by create a new custom
and then creating new data providers for all our data layers and updating the existing data layers using the method
 setDataProvider(IDataProvider dataProvider)

We now want to enable users to save the current configuration of their tables using the persistence mechanism that already exists. We export their configuration to a file and re-import it when a new table is created. The problem is that the validity of a exported configuration depends on which classes of elements were present when the configuration was exported.

Example (Conf1 applies when elements for ClassA and ClassB are present in the table since they have 10 common features that are editable, but not for ClassC that only has 2 editable features).

We therefore want to display only the valid configurations for the current elements that are present in the table. The DisplayPersistenceDialogCommandHandler contains all the logic and it also contains the PersistenceDialog that is displayed. We wanted to modify some of the behavior for the PersistenceDialog in order to only display the valid configurations for the current contained elements, but all the needed fields including the TableViewer are private and not protected ...

We found a workaround but this approach is not sufficient for our needs. We do this by creating a custom PersistenceDialogCommandHandler that registers a state change listener, and when a new configuration is created it also adds a new key to the properties object that contains the present classes. And when the custom PersistenceDialogCommandHandler is created, we basicaly delete all invalid configurations that don't match with the current elements.

What options do we have in order to reuse the existing PersistenceDialog and avoid duplicating the code on our side?

[Updated on: Tue, 03 April 2018 15:12]

Report message to a moderator

Re: Custom persistence behavior and modifying the PersistenceDialog [message #1784759 is a reply to message #1784563] Tue, 03 April 2018 16:14 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2814
Registered: July 2012
Senior Member
Typically you only need to create a ticket with your enhancement request and provide a patch.
Previous Topic:Sorting not proper
Next Topic:GAP between the custom image and base content with background image
Goto Forum:

Current Time: Sun Jul 25 07:41:51 GMT 2021

Powered by FUDForum. Page generated in 0.01696 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top