com.quadrique.jbuildingblocks.gui
Class SelectionHandler

java.lang.Object
  extended by com.quadrique.jbuildingblocks.gui.SelectionHandler

public class SelectionHandler
extends Object

This class provides a generic selection handling framework It handles multiple selection events and provides a simple common interface for all the selection handling events + listeners

Author:
Hervé Rivere

Constructor Summary
SelectionHandler()
          Constructor
 
Method Summary
 void addListener(SelectionListener zListener)
          Call this method to register and to be notiifed of selection changes
static SelectionHandler getInstance()
          This method returns an instance of the SelectionHandler class.
 void newSelection(SelectionBaseEvent zEvent)
          Whenever a new selection occurs, the correspondIng component needs to call this method so that all the registered listener(s) can be notified of the selection change
 void removeListener(SelectionListener zListener)
          Call this method to remove a previously registered listener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectionHandler

public SelectionHandler()
Constructor

Method Detail

getInstance

public static final SelectionHandler getInstance()
This method returns an instance of the SelectionHandler class. If there has been already one instantiation, the same instance is returned so that it can be shared accross the application. A typical would be: SelectionHandler.getInstance().getXxxx() or SelectionHandler lCursor = SelectionHandler.getInstance();

Returns:
the unique SelectionHandler instance

newSelection

public void newSelection(SelectionBaseEvent zEvent)
Whenever a new selection occurs, the correspondIng component needs to call this method so that all the registered listener(s) can be notified of the selection change

Parameters:
zEvent - the selection event

addListener

public void addListener(SelectionListener zListener)
                 throws Exception
Call this method to register and to be notiifed of selection changes

Parameters:
zListener - a reference to an instance of a class that implements the SelectionListener interface.
Throws:
Exception - if an error occurs

removeListener

public void removeListener(SelectionListener zListener)
Call this method to remove a previously registered listener

Parameters:
zListener - a reference to an instance of a class that implements the SelectionListener interface.
See Also:
SelectionListener


Copyright © 2001-2009 Quadrique Corporation. All Rights Reserved.