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

Bug 218884

Summary: [DataBinding] Add API: WorkbenchObservables
Product: [Eclipse Project] Platform Reporter: Boris Bokowski <bokowski>
Component: UIAssignee: Boris Bokowski <bokowski>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: fg, mallo.ovidio, qualidafial
Version: 3.4Keywords: api, helpwanted
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch
none
better patch
none
Patch none

Description Boris Bokowski CLA 2008-02-13 16:57:05 EST
... for things like listening to ISelectionService
Comment 1 Boris Bokowski CLA 2008-02-13 17:07:46 EST
No idea if I will have time for this, but if we want it in 3.4, it would have to happen fairly soon.
Comment 2 Boris Bokowski CLA 2008-03-24 02:53:17 EDT
Ran out of time.
Comment 3 Matthew Hall CLA 2009-01-21 23:27:30 EST
Don't we have to have a separate bundle with org.eclipse.ui as a dependency first?
Comment 4 Boris Bokowski CLA 2009-01-22 00:15:36 EST
(In reply to comment #3)
> Don't we have to have a separate bundle with org.eclipse.ui as a dependency
> first?

No - org.eclipse.ui.workbench has a dependency on core.databinding and jface.databinding already. We should put any new API in a separate package though.
Comment 5 Boris Bokowski CLA 2009-03-06 21:50:39 EST
Frank, quick - which API would you like to see? You have 24 hours for your answer... :-)
Comment 6 Boris Bokowski CLA 2009-03-08 12:32:55 EDT
going once...
Comment 7 Boris Bokowski CLA 2009-03-09 00:23:44 EDT
Created attachment 127983 [details]
patch

going twice... shout if you need more than this.
Comment 8 Boris Bokowski CLA 2009-03-09 00:45:10 EDT
Created attachment 127986 [details]
better patch

With this patch, you will be able to write (in a view, or an editor):

IObservableValue input = WorkbenchObservables.observeAdaptedSingleSelection(getSite(),IResource.class);
Observables.pipe(input, ViewersObservables.observeInput(myViewer));

Comments or questions?
Comment 9 Boris Bokowski CLA 2009-03-09 15:20:04 EDT
Matthew, +1?
Comment 10 Matthew Hall CLA 2009-03-09 17:01:35 EDT
Created attachment 128106 [details]
Patch

Added methods to WorkbenchProperties:

IValueProperty adaptedValue(Class adapter)
IValueProperty adaptedValue(Class adapter, IAdapterManager adapterManager)

Renamed WorkbenchObservables.observeAdaptedValue to observeDetailAdaptedValue since it receives an IObservableValue.
Comment 11 Boris Bokowski CLA 2009-03-09 17:12:24 EDT
Released to HEAD.