com.ca.directory.jxplorer.search
Class ReturnAttributesDisplay

java.lang.Object
  |
  +--com.ca.directory.jxplorer.search.ReturnAttributesDisplay
All Implemented Interfaces:
DataListener

public class ReturnAttributesDisplay
extends java.lang.Object
implements DataListener

This class is currently called from the Search GUI when the user has requested that certain attributes are returned in the search.

The way it is intended to work is the SearchGUI creates a ReturnAttributesDisplay object by calling the constructor. The constructor does nothing more than registers two global variables. The creator of the object is expected to register a DataSource via the registerDataSource method so that this object is added to it as a DataListener.

When the search returns, all the DataListener objects are notified with the results of the search (hense this class) via the dataReady method. The dataReady method calls the displaySearchResult method which extracts the attribute values from the search results. It is this method that creates a static ReturnAttributesGUI which displays the results in a table. Only one copy of ReturnAttributesGUI is initiated. If one is already open when a search result is received we just reset the data in it's table.


Constructor Summary
ReturnAttributesDisplay(JXplorer jx, java.lang.String[] tableHeader)
          Constructor that does nothing more than register the params as global variables.
 
Method Summary
 void dataReady(DataQuery result)
          This is the data listener interface - this method is called when a (Search) data query is finished by a Broker.
protected  void displaySearchResult(DataQuery result)
          This method basically takes the search result and extracts the attribute values then populates a two-dimensional array with these values.
 void registerDataSource(DataSource ds)
          Registers a given DataSource and notifies it that this class is a DataListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReturnAttributesDisplay

public ReturnAttributesDisplay(JXplorer jx,
                               java.lang.String[] tableHeader)
Constructor that does nothing more than register the params as global variables.

Parameters:
jx - the owing frame.
tableHeader - contains a list of attributes that the user wants returned (is used as the table header).
Method Detail

registerDataSource

public void registerDataSource(DataSource ds)
Registers a given DataSource and notifies it that this class is a DataListener.

Parameters:
ds - the DataSource to be registered.

dataReady

public void dataReady(DataQuery result)
This is the data listener interface - this method is called when a (Search) data query is finished by a Broker.

Specified by:
dataReady in interface DataListener
Parameters:
result - the search result.

displaySearchResult

protected void displaySearchResult(DataQuery result)
This method basically takes the search result and extracts the attribute values then populates a two-dimensional array with these values. The array is used to initiate the JTable that is used in the gui.

Parameters:
result - the search result.