Class ViewersObservables
- java.lang.Object
-
- org.eclipse.jface.databinding.viewers.ViewersObservables
-
public class ViewersObservables extends Object
Factory methods for creating observables for JFace viewers- Since:
- 1.1
-
-
Constructor Summary
Constructors Constructor Description ViewersObservables()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static IViewerObservableSet
observeCheckedElements(CheckboxTableViewer viewer, Object elementType)
Deprecated.useViewerProperties
insteadstatic IViewerObservableSet
observeCheckedElements(CheckboxTreeViewer viewer, Object elementType)
Deprecated.useViewerProperties
insteadstatic IObservableSet
observeCheckedElements(ICheckable checkable, Object elementType)
Deprecated.useViewerProperties
insteadstatic <T> IViewerObservableValue<T>
observeDelayedValue(int delay, IViewerObservableValue<T> observable)
Returns an observable which delays notification of value change events fromobservable
untildelay
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)
Deprecated.useViewerProperties
insteadstatic IObservableValue
observeInput(Viewer viewer)
Deprecated.useViewerProperties
insteadstatic IObservableList
observeMultiPostSelection(IPostSelectionProvider selectionProvider)
Deprecated.useViewerProperties
insteadstatic IViewerObservableList
observeMultiPostSelection(StructuredViewer viewer)
Deprecated.useViewerProperties
insteadstatic IObservableList
observeMultiSelection(ISelectionProvider selectionProvider)
Deprecated.useViewerProperties
insteadstatic IViewerObservableList
observeMultiSelection(Viewer viewer)
Deprecated.useViewerProperties
insteadstatic IObservableValue
observeSinglePostSelection(IPostSelectionProvider selectionProvider)
Deprecated.useViewerProperties
insteadstatic IViewerObservableValue
observeSinglePostSelection(StructuredViewer viewer)
Deprecated.useViewerProperties
insteadstatic IObservableValue
observeSingleSelection(ISelectionProvider selectionProvider)
Deprecated.useViewerProperties
insteadstatic IViewerObservableValue
observeSingleSelection(Viewer viewer)
Deprecated.useViewerProperties
instead
-
-
-
Method Detail
-
observeDelayedValue
public static <T> IViewerObservableValue<T> observeDelayedValue(int delay, IViewerObservableValue<T> observable)
Returns an observable which delays notification of value change events fromobservable
untildelay
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.- Parameters:
delay
- the delay in millisecondsobservable
- the observable being delayed- Returns:
- an observable which delays notification of value change events
from
observable
untildelay
milliseconds have passed since the last change event. - Since:
- 1.3
-
observeSingleSelection
@Deprecated public static IObservableValue observeSingleSelection(ISelectionProvider selectionProvider)
Deprecated.useViewerProperties
insteadReturns an observable value that tracks the current selection of the given selection provider. If the selection provider provides selections of typeIStructuredSelection
, the observable value will be the first element of the structured selection as returned byIStructuredSelection.getFirstElement()
.- Parameters:
selectionProvider
-- Returns:
- the observable value tracking the (single) selection of the given selection provider
-
observeSinglePostSelection
@Deprecated public static IObservableValue observeSinglePostSelection(IPostSelectionProvider selectionProvider)
Deprecated.useViewerProperties
insteadReturns an observable value that tracks the current post selection of the given post selection provider. If the selection provider provides selections of typeIStructuredSelection
, the observable value will be the first element of the structured selection as returned byIStructuredSelection.getFirstElement()
.- Parameters:
selectionProvider
- The selection provider on which to track the post selection.- Returns:
- the observable value tracking the (single) post selection of the given post selection provider
- Since:
- 1.4
-
observeMultiSelection
@Deprecated public static IObservableList observeMultiSelection(ISelectionProvider selectionProvider)
Deprecated.useViewerProperties
insteadReturns an observable list that tracks the current selection of the given selection provider. Assumes that the selection provider provides selections of typeIStructuredSelection
. Note that the observable list will not honor the full contract ofjava.util.List
in that it may delete or reorder elements based on what the selection provider returns fromISelectionProvider.getSelection()
after having calledISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
based on the requested change to the observable list. The affected methods areadd
,addAll
, andset
.- Parameters:
selectionProvider
-- Returns:
- the observable value tracking the (multi) selection of the given selection provider
- Since:
- 1.2
-
observeMultiPostSelection
@Deprecated public static IObservableList observeMultiPostSelection(IPostSelectionProvider selectionProvider)
Deprecated.useViewerProperties
insteadReturns an observable list that tracks the current post selection of the given post selection provider. Assumes that the selection provider provides selections of typeIStructuredSelection
. Note that the observable list will not honor the full contract ofjava.util.List
in that it may delete or reorder elements based on what the selection provider returns fromISelectionProvider.getSelection()
after having calledISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
based on the requested change to the observable list. The affected methods areadd
,addAll
, andset
.- Parameters:
selectionProvider
- The selection provider on which to track the post selection.- Returns:
- the observable value tracking the (multi) post selection of the given post selection provider
- Since:
- 1.4
-
observeSingleSelection
@Deprecated public static IViewerObservableValue observeSingleSelection(Viewer viewer)
Deprecated.useViewerProperties
insteadReturns an observable value that tracks the current selection of the given viewer. If the viewer provides selections of typeIStructuredSelection
, the observable value will be the first element of the structured selection as returned byIStructuredSelection.getFirstElement()
.- Parameters:
viewer
- the viewer- Returns:
- the observable value tracking the (single) selection of the given viewer
- Since:
- 1.2
-
observeSinglePostSelection
@Deprecated public static IViewerObservableValue observeSinglePostSelection(StructuredViewer viewer)
Deprecated.useViewerProperties
insteadReturns an observable value that tracks the current post selection of the given structured viewer. If the viewer provides selections of typeIStructuredSelection
, the observable value will be the first element of the structured selection as returned byIStructuredSelection.getFirstElement()
.- Parameters:
viewer
- The viewer on which to track the post selection.- Returns:
- the observable value tracking the (single) post selection of the given structured viewer
- Since:
- 1.4
-
observeMultiSelection
@Deprecated public static IViewerObservableList observeMultiSelection(Viewer viewer)
Deprecated.useViewerProperties
insteadReturns an observable list that tracks the current selection of the given viewer. Assumes that the viewer provides selections of typeIStructuredSelection
. Note that the observable list will not honor the full contract ofjava.util.List
in that it may delete or reorder elements based on what the viewer returns fromISelectionProvider.getSelection()
after having calledISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
based on the requested change to the observable list. The affected methods areadd
,addAll
, andset
.- Parameters:
viewer
-- Returns:
- the observable value tracking the (multi) selection of the given selection provider
- Since:
- 1.2
-
observeMultiPostSelection
@Deprecated public static IViewerObservableList observeMultiPostSelection(StructuredViewer viewer)
Deprecated.useViewerProperties
insteadReturns an observable list that tracks the current post selection of the given structured viewer. Assumes that the viewer provides selections of typeIStructuredSelection
. Note that the observable list will not honor the full contract ofjava.util.List
in that it may delete or reorder elements based on what the viewer returns fromISelectionProvider.getSelection()
after having calledISelectionProvider.setSelection(org.eclipse.jface.viewers.ISelection)
based on the requested change to the observable list. The affected methods areadd
,addAll
, andset
.- Parameters:
viewer
- The viewer on which to track the post selection.- Returns:
- the observable value tracking the (multi) post selection of the given structured viewer
- Since:
- 1.4
-
observeInput
@Deprecated public static IObservableValue observeInput(Viewer viewer)
Deprecated.useViewerProperties
insteadReturns an observable value that tracks the input of the given viewer.The returned observer is blind to changes in the viewer's input unless its
IObservableValue.setValue(Object)
method is called directly.- Parameters:
viewer
- the viewer to observe- Returns:
- an observable value tracking the input of the given viewer
- Since:
- 1.2
-
observeCheckedElements
@Deprecated public static IObservableSet observeCheckedElements(ICheckable checkable, Object elementType)
Deprecated.useViewerProperties
insteadReturns an observable set that tracks the checked elements of the givenICheckable
.- Parameters:
checkable
-ICheckable
containing the checked elements to trackelementType
- element type of the returned set- Returns:
- an observable set tracking the checked elements of the given checkable.
- Since:
- 1.2
-
observeCheckedElements
@Deprecated public static IViewerObservableSet observeCheckedElements(CheckboxTableViewer viewer, Object elementType)
Deprecated.useViewerProperties
insteadReturns an observable set that tracks the checked elements of the given viewer. Assumes that the viewer implementsICheckable
.- Parameters:
viewer
-CheckboxTableViewer
containing the checked elements to track.elementType
- element type of the returned set- Returns:
- an observable set that tracks the checked elements of the given viewer.
- Since:
- 1.2
-
observeCheckedElements
@Deprecated public static IViewerObservableSet observeCheckedElements(CheckboxTreeViewer viewer, Object elementType)
Deprecated.useViewerProperties
insteadReturns an observable set that tracks the checked elements of the given viewer. Assumes that the viewer implementsICheckable
.- Parameters:
viewer
-CheckboxTreeViewer
containing the checked elements to track.elementType
- element type of the returned set- Returns:
- an observable set that tracks the checked elements of the given viewer.
- Since:
- 1.2
-
observeFilters
@Deprecated public static IViewerObservableSet observeFilters(StructuredViewer viewer)
Deprecated.useViewerProperties
insteadReturns an observable set that tracks the filters of the given viewer. Note that the returned set will not track changes that are made using direct API on StructuredViewer (by callingaddFilter()
,removeFilter()
, orsetFilters()
) -- it is assumed that filters are only changed through the returned set.- Parameters:
viewer
- viewer containing the filters to be tracked- Returns:
- an observable set that tracks the filters of the given viewer.
- Since:
- 1.3
-
-