Package org.eclipse.ui.databinding.typed
Class WorkbenchProperties
java.lang.Object
org.eclipse.ui.databinding.typed.WorkbenchProperties
Factory methods for creating properties for the Workbench.
Examples:
WorkbenchProperties.singleSelection().observe(getSite().getService(ISelectionService.class))
- Since:
- 3.117
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <S extends IPageService>
IValueProperty<S,IWorkbenchPage> Returns a property for observing the active page of a workbench window.static <S extends IPartService>
IValueProperty<S,IEditorReference> Returns a property for observing the active part reference of a part service, casted toIEditorReference
.static <S extends IPartService>
IValueProperty<S,IWorkbenchPartReference> Returns a property for observing the active part reference of a part service.static <S extends IWorkbench>
IValueProperty<S,IWorkbenchWindow> Returns a property for observing the active window of a workbench.static <S,
T> IValueProperty<S, T> adaptedValue
(Class<T> adapter) Returns a value property which observes the source object as the adapted type, using the platform adapter manager.static <S,
T> IValueProperty<S, T> adaptedValue
(Class<T> adapter, IAdapterManager adapterManager) Returns a value property which observes the source object as the adapted type.static <S extends IEditorPart>
IValueProperty<S,IEditorInput> Returns a property for observing the editor input an editor part.static <S extends ISelectionService,
E>
IListProperty<S,E> Returns a property for observing the elements of a structured selection as exposed byISelectionService
.static <S extends ISelectionService,
E>
IListProperty<S,E> multipleSelection
(Class<E> elementType) Returns a property for observing the elements of a structured selection as exposed byISelectionService
.static <S extends ISelectionService,
E>
IListProperty<S,E> multipleSelection
(String partId, boolean postSelection) Returns a property for observing the elements of a structured selection as exposed byISelectionService
.static <S extends ISelectionService,
E>
IListProperty<S,E> multipleSelection
(String partId, boolean postSelection, Class<E> elementType) Returns a property for observing the elements of a structured selection as exposed byISelectionService
.static <S extends ISelectionService,
T>
IValueProperty<S,T> Returns a property for observing the first element of a structured selection as exposed byISelectionService
.static <S extends ISelectionService,
T>
IValueProperty<S,T> singleSelection
(String partId, boolean postSelection) Returns a property for observing the first element of a structured selection as exposed byISelectionService
.static <S extends ISelectionService,
T>
IValueProperty<S,T> singleSelection
(String partId, boolean postSelection, Class<T> valueType) Returns a property for observing the first element of a structured selection as exposed byISelectionService
.
-
Constructor Details
-
WorkbenchProperties
public WorkbenchProperties()
-
-
Method Details
-
adaptedValue
Returns a value property which observes the source object as the adapted type, using the platform adapter manager. If the source is of the target type, or can be adapted to the target type, this is used as the value of property, otherwisenull
.- Parameters:
adapter
- the adapter class- Returns:
- a value property which observes the source object as the adapted type.
-
adaptedValue
public static <S,T> IValueProperty<S,T> adaptedValue(Class<T> adapter, IAdapterManager adapterManager) Returns a value property which observes the source object as the adapted type. If the source object is of the target type, or can be adapted to the target type, this is used as the value of property, otherwisenull
.- Parameters:
adapter
- the adapter classadapterManager
- the adapter manager used to adapt source objects- Returns:
- a value property which observes the source object as the adapted type.
-
singleSelection
Returns a property for observing the first element of a structured selection as exposed byISelectionService
.- Returns:
- an observable value
-
singleSelection
public static <S extends ISelectionService,T> IValueProperty<S,T> singleSelection(String partId, boolean postSelection) Returns a property for observing the first element of a structured selection as exposed byISelectionService
.- Parameters:
partId
- the part id, ornull
if the selection can be from any partpostSelection
-true
if the selection should be delayed for keyboard-triggered selections- Returns:
- an observable value
-
singleSelection
public static <S extends ISelectionService,T> IValueProperty<S,T> singleSelection(String partId, boolean postSelection, Class<T> valueType) Returns a property for observing the first element of a structured selection as exposed byISelectionService
.- Parameters:
partId
- the part id, ornull
if the selection can be from any partpostSelection
-true
if the selection should be delayed for keyboard-triggered selectionsvalueType
- value type of the selection- Returns:
- an observable value
-
multipleSelection
Returns a property for observing the elements of a structured selection as exposed byISelectionService
.- Returns:
- an observable value
-
multipleSelection
public static <S extends ISelectionService,E> IListProperty<S,E> multipleSelection(Class<E> elementType) Returns a property for observing the elements of a structured selection as exposed byISelectionService
.- Parameters:
elementType
- element type of the selection- Returns:
- an observable value
-
multipleSelection
public static <S extends ISelectionService,E> IListProperty<S,E> multipleSelection(String partId, boolean postSelection) Returns a property for observing the elements of a structured selection as exposed byISelectionService
.- Parameters:
partId
- the part id, ornull
if the selection can be from any partpostSelection
-true
if the selection should be delayed for keyboard-triggered selections- Returns:
- an observable value
-
multipleSelection
public static <S extends ISelectionService,E> IListProperty<S,E> multipleSelection(String partId, boolean postSelection, Class<E> elementType) Returns a property for observing the elements of a structured selection as exposed byISelectionService
.- Parameters:
partId
- the part id, ornull
if the selection can be from any partpostSelection
-true
if the selection should be delayed for keyboard-triggered selectionselementType
- type of selection elements- Returns:
- an observable value
-
activeWindow
Returns a property for observing the active window of a workbench. The value is null if there is no active window.- Returns:
- the property
- Since:
- 3.120
- See Also:
-
activePage
Returns a property for observing the active page of a workbench window. The value is null if there is no active page.- Returns:
- the property
- Since:
- 3.120
- See Also:
-
activePartReference
public static <S extends IPartService> IValueProperty<S,IWorkbenchPartReference> activePartReference()Returns a property for observing the active part reference of a part service. The value is null if there is no active part.- Returns:
- the property
- Since:
- 3.120
- See Also:
-
activePartAsEditorReference
public static <S extends IPartService> IValueProperty<S,IEditorReference> activePartAsEditorReference()Returns a property for observing the active part reference of a part service, casted toIEditorReference
. The value is null if the active part is not anIEditorReference
. Note that this value is different fromIWorkbenchPage.getActiveEditor()
.- Returns:
- the property
- Since:
- 3.120
- See Also:
-
editorInput
Returns a property for observing the editor input an editor part.- Returns:
- the property
- Since:
- 3.120
- See Also:
-