Example usage for org.springframework.ide.eclipse.boot.dash.livexp MultiSelection from

List of usage examples for org.springframework.ide.eclipse.boot.dash.livexp MultiSelection from

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.livexp MultiSelection from.

Prototype

public static <T> MultiSelection<T> from(Class<T> type, ObservableSet<T> elements) 

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.views.sections.BootDashUnifiedTreeSection.java

private synchronized MultiSelection<Object> getMixedSelection() {
    if (mixedSelection == null) {
        mixedSelection = MultiSelection.from(Object.class, new ObservableSet<Object>() {
            @Override//from w  w  w.j a va 2s .  co  m
            protected ImmutableSet<Object> compute() {
                if (tv != null) {
                    ISelection s = tv.getSelection();
                    if (s instanceof IStructuredSelection) {
                        Object[] elements = ((IStructuredSelection) s).toArray();
                        return ImmutableSet.copyOf(elements);
                    }
                }
                return ImmutableSet.of();
            }
        });
        debug("mixedSelection", mixedSelection.getElements());
    }
    if (tv != null) {
        addViewerSelectionListener();
    }
    return mixedSelection;
}