Bug 172652 - [Viewers] Provide Listener API for model modification events
Summary: [Viewers] Provide Listener API for model modification events
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-02 08:02 EST by Thomas Schindl CLA
Modified: 2014-06-26 11:24 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schindl CLA 2007-02-02 08:02:32 EST
to keep model and viewer in sync when using add/remove one needs some custom code and this can easily lead to inconsitency between what is represented in the view and underlying model. I think it would make sense if we provide some model-modification-events.
Comment 1 Boris Bokowski CLA 2007-02-02 09:55:19 EST
Yes - but this already exists in the form of IObservableSet/IObservableList.

IObservableList is the new IStructuredContentProvider (if you don't use a sorter on the viewer and would like to control the order of elements).

IObservableSet is the new IStructuredContentProvider (if you set a sorter on the viewer).

In JFace data binding, we have adapters for turning one of these into an old-style content provider.
Comment 2 Thomas Schindl CLA 2007-02-02 10:00:56 EST
well but i think this should also be available for none databinding users. Can we move it from there to JFace?
Comment 3 Boris Bokowski CLA 2007-02-02 10:06:11 EST
You don't have to use all of data binding in order to use IObservableSet as a replacement for what used to be the content provider.  Just like you don't have to use all of JFace if all you need is a tree viewer.

IObservableSet/List/Map/Value don't even depend on JFace or SWT so no, I would not put that into JFace.
Comment 4 Matthew Hall CLA 2008-07-02 15:09:22 EDT
The input observable list or set cannot be reliably used for determining what elements are actually present in the viewer, if the viewer has any filters.  This could be solved either by adding a listener API to JFace, or by introducing filtered lists / sets into DataBinding.
Comment 5 Boris Bokowski CLA 2008-07-02 16:56:10 EDT
(In reply to comment #4)
> The input observable list or set cannot be reliably used for determining what
> elements are actually present in the viewer, if the viewer has any filters. 
> This could be solved either by adding a listener API to JFace, or by
> introducing filtered lists / sets into DataBinding.

I am leaning towards introducing filtered lists and sets into the data binding framework.
Comment 6 Boris Bokowski CLA 2009-11-26 09:47:53 EST
Hitesh is now responsible for watching bugs in the [Viewers] component area.