Skip to content

Conversation

@kenbot
Copy link

@kenbot kenbot commented Jan 2, 2012

Hi Ingo,
Sorry for my long inactivity this last year -- I've now improved the Tree-view design in a number of respects. TreeDemo contains examples of most of the desired use cases.

  1. Internal/External model split. TreeModels are now either External (virtual descriptions of some arbitrary external structure) or Internal (an eagerly-initialised internally stored tree structure copied from some external structure).

  2. A way to update, edit, add and remove nodes, for external and internal models. All models have update(), remove(), insertUnder(), insertAfter() and insertBefore() methods.

Using an internal representation gives you these for free, whereas an external model needs them provided with the makeUpdatableWith(), makeInsertableWith() and makeRemovableWith() methods.

  1. Tree.Path is now IndexedSeq instead of List.

  2. map and filter methods for TreeModels. Currently the ExternalTreeModel has to turn itself into an InternalTreeModel to do a map, which is not very satisfactory.

  3. ListView has been integrated into the CellView abstraction. There is unfortunately a minor backwards-compat problem -- the componentFor method in existing subclasses of ListView.Renderer would need to be marked "override". I'm not sure how much of a problem this is, but this is as close as I can get without jettisoning the (IMHO beneficial) CellInfo abstraction.

The ListView integration is in a separate commit to the Tree stuff, so it can be safely left out if you think it's a bit hairy at this stage.

NB
Table hasn't been integrated yet; it can't have a straight renderer method, it needs to be per-row/column. I suspect that RenderableCells and EditableCells will have to be snipped or eliminated to fit Table into the system.

kenbot added 4 commits March 14, 2011 23:20
…ted. Inserting, adding, editing and removing nodes works for both. The demo has been updated.
…ced to requiring an explicit override keyword on the old componentFor method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant