public class ViewersObservables extends Object
Constructor and Description |
---|
ViewersObservables() |
Modifier and Type | Method and Description |
---|---|
static IViewerObservableSet |
observeCheckedElements(CheckboxTableViewer viewer,
Object elementType)
Returns an observable set that tracks the checked elements of the given
viewer.
|
static IViewerObservableSet |
observeCheckedElements(CheckboxTreeViewer viewer,
Object elementType)
Returns an observable set that tracks the checked elements of the given
viewer.
|
static IObservableSet |
observeCheckedElements(ICheckable checkable,
Object elementType)
Returns an observable set that tracks the checked elements of the given
ICheckable . |
static IViewerObservableValue |
observeDelayedValue(int delay,
IViewerObservableValue observable)
Returns an observable which delays notification of value change events
from
observable until delay milliseconds have
passed since the last change event, or until a FocusOut event is received
from the underlying viewer control (whichever happens earlier). |
static IViewerObservableSet |
observeFilters(StructuredViewer viewer)
Returns an observable set that tracks the filters of the given viewer.
|
static IObservableValue |
observeInput(Viewer viewer)
Returns an observable value that tracks the input of the given viewer.
|
static IObservableList |
observeMultiPostSelection(IPostSelectionProvider selectionProvider)
Returns an observable list that tracks the current post selection
of the given post selection provider.
|
static IViewerObservableList |
observeMultiPostSelection(StructuredViewer viewer)
Returns an observable list that tracks the current post selection
of the given structured viewer.
|
static IObservableList |
observeMultiSelection(ISelectionProvider selectionProvider)
Returns an observable list that tracks the current selection of the given
selection provider.
|
static IViewerObservableList |
observeMultiSelection(Viewer viewer)
Returns an observable list that tracks the current selection of the given
viewer.
|
static IObservableValue |
observeSinglePostSelection(IPostSelectionProvider selectionProvider)
Returns an observable value that tracks the current post selection
of the given post selection provider.
|
static IViewerObservableValue |
observeSinglePostSelection(StructuredViewer viewer)
Returns an observable value that tracks the current post selection
of the given structured viewer.
|
static IObservableValue |
observeSingleSelection(ISelectionProvider selectionProvider)
Returns an observable value that tracks the current selection of the
given selection provider.
|
static IViewerObservableValue |
observeSingleSelection(Viewer viewer)
Returns an observable value that tracks the current selection of the
given viewer.
|
public static IViewerObservableValue observeDelayedValue(int delay, IViewerObservableValue observable)
observable
until delay
milliseconds have
passed since the last change event, or until a FocusOut event is received
from the underlying viewer control (whichever happens earlier). This
class helps to delay validation until the user stops changing the value
(e.g. until a user stops changing a viewer selection). To notify about
pending changes, the returned observable value will fire a stale event
when the wrapped observable value fires a change event, but this change
is being delayed.delay
- the delay in millisecondsobservable
- the observable being delayedobservable
until delay
milliseconds have passed since the last change event.public static IObservableValue observeSingleSelection(ISelectionProvider selectionProvider)
IStructuredSelection
, the observable value will be the
first element of the structured selection as returned by
IStructuredSelection.getFirstElement()
.selectionProvider
- public static IObservableValue observeSinglePostSelection(IPostSelectionProvider selectionProvider)
IStructuredSelection
, the observable value
will be the first element of the structured selection as returned by
IStructuredSelection.getFirstElement()
.selectionProvider
- The selection provider on which to track the post
selection.public static IObservableList observeMultiSelection(ISelectionProvider selectionProvider)
IStructuredSelection
. Note that the observable
list will not honor the full contract of java.util.List
in
that it may delete or reorder elements based on what the selection
provider returns from ISelectionProvider.getSelection()
after
having called
ISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
based on the requested change to the observable list. The affected
methods are add
, addAll
, and set
.selectionProvider
- public static IObservableList observeMultiPostSelection(IPostSelectionProvider selectionProvider)
IStructuredSelection
. Note that the
observable list will not honor the full contract of
java.util.List
in that it may delete or reorder elements
based on what the selection provider returns from
ISelectionProvider.getSelection()
after having called
ISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
based on the requested change to the observable list. The affected
methods are add
, addAll
, and set
.selectionProvider
- The selection provider on which to track the post
selection.public static IViewerObservableValue observeSingleSelection(Viewer viewer)
IStructuredSelection
, the observable value will be the first
element of the structured selection as returned by
IStructuredSelection.getFirstElement()
.viewer
- the viewerpublic static IViewerObservableValue observeSinglePostSelection(StructuredViewer viewer)
IStructuredSelection
, the observable value will be the first
element of the structured selection as returned by
IStructuredSelection.getFirstElement()
.viewer
- The viewer on which to track the post selection.public static IViewerObservableList observeMultiSelection(Viewer viewer)
IStructuredSelection
. Note that the observable list will not
honor the full contract of java.util.List
in that it may
delete or reorder elements based on what the viewer returns from
ISelectionProvider.getSelection()
after having called
ISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
based on the requested change to the observable list. The affected
methods are add
, addAll
, and set
.viewer
- public static IViewerObservableList observeMultiPostSelection(StructuredViewer viewer)
IStructuredSelection
. Note that the observable
list will not honor the full contract of java.util.List
in
that it may delete or reorder elements based on what the viewer returns
from ISelectionProvider.getSelection()
after having called
ISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
based on the requested change to the observable list. The affected
methods are add
, addAll
, and set
.viewer
- The viewer on which to track the post selection.public static IObservableValue observeInput(Viewer viewer)
The returned observer is blind to changes in the viewer's input unless
its IObservableValue.setValue(Object)
method is called directly.
viewer
- the viewer to observepublic static IObservableSet observeCheckedElements(ICheckable checkable, Object elementType)
ICheckable
.checkable
- ICheckable
containing the checked elements to trackelementType
- element type of the returned setpublic static IViewerObservableSet observeCheckedElements(CheckboxTableViewer viewer, Object elementType)
ICheckable
.viewer
- CheckboxTableViewer
containing the checked elements to
track.elementType
- element type of the returned setpublic static IViewerObservableSet observeCheckedElements(CheckboxTreeViewer viewer, Object elementType)
ICheckable
.viewer
- CheckboxTreeViewer
containing the checked elements to
track.elementType
- element type of the returned setpublic static IViewerObservableSet observeFilters(StructuredViewer viewer)
addFilter()
,
removeFilter()
, or
setFilters()
) -- it is assumed that filters are only changed through the
returned set.viewer
- viewer containing the filters to be tracked
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.