com.jgoodies.binding.binder
Class ListBindingBuilderImpl

java.lang.Object
  extended by com.jgoodies.binding.binder.ListBindingBuilderImpl
All Implemented Interfaces:
ListBindingBuilder

public class ListBindingBuilderImpl
extends Object
implements ListBindingBuilder

Holds a ListModel and ListSelectionModel that can be bound to a list or table.

Since:
2.3
Version:
$Revision: 1.2 $
Author:
Karsten Lentzsch

Constructor Summary
ListBindingBuilderImpl(List<?> data, ListSelectionModel selectionModel)
           
ListBindingBuilderImpl(ListModel dataModel, ListSelectionModel selectionModel)
          Creates a ListBindingBuilderImpl for the given list model and list selection model.
ListBindingBuilderImpl(Object[] data, ListSelectionModel selectionModel)
           
 
Method Summary
 void to(JList list)
          Sets this builder's ListModel and ListSelectionModel in the given list.
 void to(JTable table)
          Sets this builder's ListModel and ListSelectionModel in the given table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListBindingBuilderImpl

public ListBindingBuilderImpl(Object[] data,
                              ListSelectionModel selectionModel)

ListBindingBuilderImpl

public ListBindingBuilderImpl(List<?> data,
                              ListSelectionModel selectionModel)

ListBindingBuilderImpl

public ListBindingBuilderImpl(ListModel dataModel,
                              ListSelectionModel selectionModel)
Creates a ListBindingBuilderImpl for the given list model and list selection model.

Parameters:
dataModel - provides the data to be bound to a component
selectionModel - provides the selection model to be bound to a component
Throws:
NullPointerException - if dataModel or selectionModel is null
Method Detail

to

public void to(JTable table)
Description copied from interface: ListBindingBuilder
Sets this builder's ListModel and ListSelectionModel in the given table. As a precondition, the table's model must implement ListModelBindable, so this builder's ListModel can be set in the TableModel.

Example:
binder.bind(contactSelectionInList).to(contactTable);

Specified by:
to in interface ListBindingBuilder
Parameters:
table - the component to set the data and selection model in

to

public void to(JList list)
Description copied from interface: ListBindingBuilder
Sets this builder's ListModel and ListSelectionModel in the given list.

Example:
binder.bind(contactSelectionInList).to(contactList);

Specified by:
to in interface ListBindingBuilder
Parameters:
list - the component to set the data and selection model in


Copyright © 2002-2013 JGoodies Software GmbH. All Rights Reserved.