org.springframework.richclient.list
Class ListMultipleSelectionGuard

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.list.AbstractListSelectionGuard
      extended by org.springframework.richclient.list.ListMultipleSelectionGuard
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class ListMultipleSelectionGuard
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 one or more item selected. This can also be configured to monitor for an exact number of selected items.

Author:
Larry Streepy

Constructor Summary
ListMultipleSelectionGuard(ValueModel selectionHolder, Guarded guarded)
          Constructor.
ListMultipleSelectionGuard(ValueModel selectionHolder, Guarded guarded, int requiredCount)
          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

ListMultipleSelectionGuard

public ListMultipleSelectionGuard(ValueModel selectionHolder,
                                  Guarded guarded)
Constructor.

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

ListMultipleSelectionGuard

public ListMultipleSelectionGuard(ValueModel selectionHolder,
                                  Guarded guarded,
                                  int requiredCount)
Constructor.

Parameters:
selectionHolder - ValueModel holding the list selection (value must be an array of int (int[]guarded - Object to guard
requiredCount - Required number of selected items to enable
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-2009 The Spring Framework. All Rights Reserved.