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

Bug 331250

Summary: Support more complex DelimitedListBindingImpl use cases
Product: z_Archived Reporter: Konstantin Komissarchik <konstantin>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: ling.hao
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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.