Class WorkbenchProperties

java.lang.Object
org.eclipse.ui.databinding.typed.WorkbenchProperties

public class WorkbenchProperties extends Object
Factory methods for creating properties for the Workbench.

Examples:

WorkbenchProperties.singleSelection().observe(getSite().getService(ISelectionService.class))
Since:
3.117
  • Constructor Details

    • WorkbenchProperties

      public WorkbenchProperties()
  • Method Details

    • adaptedValue

      public 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. If the source is of the target type, or can be adapted to the target type, this is used as the value of property, otherwise null.
      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, otherwise null.
      Parameters:
      adapter - the adapter class
      adapterManager - the adapter manager used to adapt source objects
      Returns:
      a value property which observes the source object as the adapted type.
    • singleSelection

      public static <S extends ISelectionService, T> IValueProperty<S,T> singleSelection()
      Returns a property for observing the first element of a structured selection as exposed by ISelectionService.
      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 by ISelectionService.
      Parameters:
      partId - the part id, or null if the selection can be from any part
      postSelection - 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 by ISelectionService.
      Parameters:
      partId - the part id, or null if the selection can be from any part
      postSelection - true if the selection should be delayed for keyboard-triggered selections
      valueType - value type of the selection
      Returns:
      an observable value
    • multipleSelection

      public static <S extends ISelectionService, E> IListProperty<S,E> multipleSelection()
      Returns a property for observing the elements of a structured selection as exposed by ISelectionService.
      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 by ISelectionService.
      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 by ISelectionService.
      Parameters:
      partId - the part id, or null if the selection can be from any part
      postSelection - 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 by ISelectionService.
      Parameters:
      partId - the part id, or null if the selection can be from any part
      postSelection - true if the selection should be delayed for keyboard-triggered selections
      elementType - type of selection elements
      Returns:
      an observable value
    • activeWindow

      public static <S extends IWorkbench> IValueProperty<S, IWorkbenchWindow> 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

      public static <S extends IPageService> IValueProperty<S, IWorkbenchPage> 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 to IEditorReference. The value is null if the active part is not an IEditorReference. Note that this value is different from IWorkbenchPage.getActiveEditor().
      Returns:
      the property
      Since:
      3.120
      See Also:
    • editorInput

      public static <S extends IEditorPart> IValueProperty<S, IEditorInput> editorInput()
      Returns a property for observing the editor input an editor part.
      Returns:
      the property
      Since:
      3.120
      See Also: