Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331250 - Support more complex DelimitedListBindingImpl use cases
Summary: Support more complex DelimitedListBindingImpl use cases
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2010-11-26 16:48 EST by Konstantin Komissarchik CLA
Modified: 2021-11-19 09:21 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Komissarchik CLA 2010-11-26 16:48:48 EST
DelimitedListBindingImpl provides an easy way to implement lists which are backed by a delimited string, but it currently provides no way to handle a more complex use cases where the extracted string tokens should map to more than one property.

Consider the following string:

abc:3.5;foo:4.3;xyz:1.2

The list delimiter is ';', which gives us a list of model elements composed around "abc:3.5", "foo:4.3" and "zyz:1.2" strings. No suppose we wanted to further break up those strings on ':' and access those parts via two separate properties. The DelimitedListBindingImpl API does not allow that because it is impossible to provide a customized implementation of the resource constructed for list entries.

Proposed API changes:

1. Rename DelimitedListBindingImpl.Entry to DelimitedListBindingImpl.ListEntryResource and make that class public and abstract.

2. Factor out code that makes single-property assumptions into a separate DefaultListEntryResource class. This class can remain private.

3. Add new protected method DelimitedListBindingImpl.createListEntryResource() which should return DefaultListEntryResource by default, but can be overridden to supply a custom implementation for ListEntryResource.
Comment 1 Konstantin Komissarchik CLA 2010-11-26 16:50:45 EST
Enhancement implemented.
Comment 2 Ling Hao CLA 2011-01-06 19:37:48 EST
Verified API changes.