public class WorkbenchObservables extends Object
Constructor and Description |
---|
WorkbenchObservables() |
Modifier and Type | Method and Description |
---|---|
static IObservableValue |
observeAdaptedSingleSelection(IServiceLocator locator,
Class targetType)
Returns an observable value that tracks the post selection of a selection
service obtained through the given service locator, and adapts the first
element of that selection to the given target type.
|
static IObservableValue |
observeDetailAdaptedValue(IObservableValue master,
Class adapter)
Returns an observable with values of the given target type.
|
public static IObservableValue observeDetailAdaptedValue(IObservableValue master, Class adapter)
null
.master
- the observable whose value should be adaptedadapter
- the target typenull
if the current value of the given observable does not adapt to
the target typepublic static IObservableValue observeAdaptedSingleSelection(IServiceLocator locator, Class targetType)
This method can be used by view or editor implementers to tie into the selection service, for example as follows:
IObservableValue selection = WorkbenchObservables .observeAdaptedSingleSelection(getSite(), IResource.class);
locator
- a service locator with an available ISelectionService
targetType
- the target type
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.