/** * Returns an observable value that tracks the input of the given viewer. * <p> * The returned observer is blind to changes in the viewer's input unless * its {@link IObservableValue#setValue(Object)} method is called directly. * * @param viewer * the viewer to observe * @return an observable value tracking the input of the given viewer * @since 1.2 */ public static IObservableValue observeInput(Viewer viewer) { checkNull(viewer); return ViewerProperties.input().observe(viewer); }
/** * Returns an observable value that tracks the current selection of the * given selection provider. If the selection provider provides selections * of type {@link IStructuredSelection}, the observable value will be the * first element of the structured selection as returned by * {@link IStructuredSelection#getFirstElement()}. * * @param selectionProvider * @return the observable value tracking the (single) selection of the given * selection provider */ public static IObservableValue observeSingleSelection( ISelectionProvider selectionProvider) { checkNull(selectionProvider); return ViewerProperties.singleSelection().observe(selectionProvider); }
/** * Returns an observable value that tracks the current selection of the * given viewer. If the viewer provides selections of type * {@link IStructuredSelection}, the observable value will be the first * element of the structured selection as returned by * {@link IStructuredSelection#getFirstElement()}. * * @param viewer * the viewer * @return the observable value tracking the (single) selection of the given * viewer * @since 1.2 */ public static IViewerObservableValue observeSingleSelection(Viewer viewer) { checkNull(viewer); return ViewerProperties.singleSelection().observe(viewer); }
/** * Returns an observable value that tracks the current <i>post</i> selection * of the given structured viewer. If the viewer provides selections of type * {@link IStructuredSelection}, the observable value will be the first * element of the structured selection as returned by * {@link IStructuredSelection#getFirstElement()}. * * @param viewer * The viewer on which to track the <i>post</i> selection. * @return the observable value tracking the (single) <i>post</i> selection * of the given structured viewer * * @since 1.4 */ public static IViewerObservableValue observeSinglePostSelection( StructuredViewer viewer) { checkNull(viewer); return ViewerProperties.singlePostSelection().observe(viewer); }
/** * Returns an observable value that tracks the current <i>post</i> selection * of the given post selection provider. If the selection provider provides * selections of type {@link IStructuredSelection}, the observable value * will be the first element of the structured selection as returned by * {@link IStructuredSelection#getFirstElement()}. * * @param selectionProvider * The selection provider on which to track the <i>post</i> * selection. * @return the observable value tracking the (single) <i>post</i> selection * of the given post selection provider * * @since 1.4 */ public static IObservableValue observeSinglePostSelection( IPostSelectionProvider selectionProvider) { checkNull(selectionProvider); return ViewerProperties.singlePostSelection() .observe(selectionProvider); }
private void bindValues() { final DataBindingContext ctx = new DataBindingContext(); { rValue = new WritableValue(); bindValue(ctx, rootName, ClasspathEntryInfo.class, ClasspathEntryInfo.P_SYMBOLIC_NAME, rValue); bindValue(ctx, rootFingerprint, ClasspathEntryInfo.class, ClasspathEntryInfo.P_FINGERPRINT, rValue); bindValue(ctx, rootVersion, ClasspathEntryInfo.class, ClasspathEntryInfo.P_VERSION, rValue); } { mValue = new WritableValue(); bindValue(ctx, modelCoordinate, ModelArchiveMetadata.class, ModelArchiveMetadata.P_COORDINATE, mValue); final IObservableValue widgetValue = ViewerProperties.singlePostSelection().observe(modelStatus); final IObservableValue modelValue = BeanProperties.value(ModelArchiveMetadata.class, ModelArchiveMetadata.P_STATUS).observeDetail(mValue); ctx.bindValue(widgetValue, modelValue); } }