org.springframework.richclient.list
Class ListSingleSelectionGuard

java.lang.Object
  extended by org.springframework.richclient.list.AbstractListSelectionGuard
      extended by org.springframework.richclient.list.ListSingleSelectionGuard
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class ListSingleSelectionGuard
extends AbstractListSelectionGuard

This class applies a guard to a Guarded object that only enables the guarded object if the provided list selection model value holder has exactly one item selected.

Author:
Larry Streepy

Constructor Summary
ListSingleSelectionGuard(ValueModel selectionHolder, Guarded guarded)
          Constructor.
 
Method Summary
protected  boolean shouldEnable(int[] selected)
          Determine if the guarded object should be enabled based on the contents of the current selection model value.
 
Methods inherited from class org.springframework.richclient.list.AbstractListSelectionGuard
getGuarded, getSelectionHolder, propertyChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListSingleSelectionGuard

public ListSingleSelectionGuard(ValueModel selectionHolder,
                                Guarded guarded)
Constructor.

Parameters:
selectionHolder - ValueModel holding the list selection (value must be an array of int (int[]guarded - Object to guard
Method Detail

shouldEnable

protected boolean shouldEnable(int[] selected)
Determine if the guarded object should be enabled based on the contents of the current selection model value.

Specified by:
shouldEnable in class AbstractListSelectionGuard
Parameters:
selected - The array of selected rows
Returns:
boolean true if the guarded object should be enabled


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.