Example usage for org.eclipse.jface.databinding.viewers.typed ViewerProperties singlePostSelection

List of usage examples for org.eclipse.jface.databinding.viewers.typed ViewerProperties singlePostSelection

Introduction

In this page you can find the example usage for org.eclipse.jface.databinding.viewers.typed ViewerProperties singlePostSelection.

Prototype

public static <S extends ISelectionProvider, T> IViewerValueProperty<S, T> singlePostSelection(
        Class<T> elementType) 

Source Link

Document

An alternative version of #singlePostSelection() which casts the property to the argument element type.

Usage

From source file:org.eclipse.jface.examples.databinding.snippets.Snippet035PostSelectionProvider.java

License:Open Source License

private void createFieldSection(Composite parent) {
    final Group section = createSectionGroup(parent, 2);

    // normal selection
    Label selectionLabel = createLabelField(section, "Selection:");
    IViewerObservableValue<String> selectionObservable = ViewerProperties.singleSelection(String.class)
            .observe(listViewer);/* w  w  w .j  ava  2s .com*/
    dbc.bindValue(WidgetProperties.text().observe(selectionLabel), selectionObservable);

    // post selection
    Label postSelectionLabel = createLabelField(section, "Post selection:");
    IViewerObservableValue<String> postSelectionObservable = ViewerProperties.singlePostSelection(String.class)
            .observe(listViewer);
    dbc.bindValue(WidgetProperties.text().observe(postSelectionLabel), postSelectionObservable);
}