/** * 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); } }