Example usage for com.jgoodies.binding.list SelectionInList SelectionInList

List of usage examples for com.jgoodies.binding.list SelectionInList SelectionInList

Introduction

In this page you can find the example usage for com.jgoodies.binding.list SelectionInList SelectionInList.

Prototype

public SelectionInList(ValueModel listHolder, ValueModel selectionHolder, ValueModel selectionIndexHolder) 

Source Link

Document

Constructs a SelectionInList on the given list holder, selection holder and selection index holder.

Constraints: 1) The listHolder must hold instances of List or ListModel and 2) must report a value change whenever the value's identity changes.

Usage

From source file:cz.vity.freerapid.gui.dialogs.DownloadHistoryDialog.java

private void bindCombobox(final JComboBox combobox, String key, final Object defaultValue,
        final String[] values) {
    if (values == null)
        throw new IllegalArgumentException("List of combobox values cannot be null!!");
    final MyPreferencesAdapter adapter = new MyPreferencesAdapter(key, defaultValue);
    final SelectionInList<String> inList = new SelectionInList<String>(values,
            new ValueHolder(values[(Integer) adapter.getValue()]), adapter);
    Bindings.bind(combobox, inList);
}