public class WorkbenchObservables extends Object
Constructor and Description |
---|
WorkbenchObservables() |
Modifier and Type | Method and Description |
---|---|
static IObservableValue<IEditorReference> |
observeActiveEditor(IPartService partService)
Returns an observable value that tracks the active editor for the given
part service.
|
static IObservableValue<IWorkbenchPartReference> |
observeActivePart(IPartService partService)
Returns an observable value that tracks the active workbench part for the
given part service.
|
static IObservableValue<IWorkbenchPage> |
observeActiveWorkbenchPage(IWorkbenchWindow window)
Returns an observable value that tracks the active workbench page for the
given workbench window.
|
static IObservableValue<IWorkbenchWindow> |
observeActiveWorkbenchWindow(IWorkbench workbench)
Returns an observable value that tracks the active workbench window for
the given workbench.
|
static <T> IObservableValue<T> |
observeAdaptedSingleSelection(IServiceLocator locator,
Class<T> 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 <T> IObservableValue<T> |
observeDetailAdaptedValue(IObservableValue<?> master,
Class<T> adapter)
Returns an observable with values of the given target type.
|
static IObservableValue<IEditorInput> |
observeEditorInput(IEditorPart editor)
Returns an observable value that tracks the editor input for the given
editor.
|
public static <T> IObservableValue<T> observeDetailAdaptedValue(IObservableValue<?> master, Class<T> 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 <T> IObservableValue<T> observeAdaptedSingleSelection(IServiceLocator locator, Class<T> targetType)
This method can be used by view or editor implementers to tie into the selection service, for example as follows:
IObservableValue<IResource> selection = WorkbenchObservables.observeAdaptedSingleSelection(getSite(), IResource.class);
locator
- a service locator with an available ISelectionService
targetType
- the target typepublic static IObservableValue<IWorkbenchWindow> observeActiveWorkbenchWindow(IWorkbench workbench)
workbench
- the workbench to get the observable forpublic static IObservableValue<IWorkbenchPage> observeActiveWorkbenchPage(IWorkbenchWindow window)
window
- the workbench window to get the observable forpublic static IObservableValue<IWorkbenchPartReference> observeActivePart(IPartService partService)
partService
- the part service to get the observable for, e.g. a workbench
pagepublic static IObservableValue<IEditorReference> observeActiveEditor(IPartService partService)
partService
- the part service to get the observable for, e.g. a workbench
pagepublic static IObservableValue<IEditorInput> observeEditorInput(IEditorPart editor)
editor
- the editor to get the observable for
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.