butler.swing.query
Class QueryController

java.lang.Object
  extended by butler.swing.query.QueryController
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class QueryController
extends java.lang.Object
implements java.awt.event.ActionListener

Controller for a query. Listens for a search action command, populates the query parameters from the filter panels and notifies listeners that a new result list is availible.

Author:
Fredrik Bertilsson

Nested Class Summary
static class QueryController.Listener
           
 
Field Summary
protected  Record _firstRec
           
protected  Record _lastRec
           
protected  boolean _scrolling
           
static java.lang.String PAGE_DOWN_ACTIONCOMMAND
           
static java.lang.String PAGE_UP_ACTIONCOMMAND
           
static java.lang.String SEARCH_ACTIONCOMMAND
           
 
Constructor Summary
QueryController()
           
QueryController(Query query)
           
QueryController(Query query, boolean scrolling)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addListener(QueryController.Listener l)
           
 void addRecordSelectionListener(RecordSelectionListener listener)
           
protected  boolean checkMandatory()
           
 QueryParams createQueryParams()
           
 void enableDownButton(boolean enable)
           
 void enableUpButton(boolean enable)
           
 Query getQuery()
           
 RecordComparator getRecordComparator()
           
 int getScrollSize()
           
 void notifyListeners(RecordList recList)
           
 void registerButtonRow(ButtonRow row)
           
 void registerDownButton(javax.swing.JButton button)
           
 void registerFilterGroupPanel(FilterGroupPanel panel)
           
 void registerFilterPanel(FilterPanel panel)
           
 void registerSortPanel(SortPanel panel)
           
 void registerStatusBar(StatusBar bar)
           
 void registerUpButton(javax.swing.JButton button)
           
 void search(boolean down, boolean first)
           
 void setComponent(java.awt.Component component)
           
protected  void setCursor(java.awt.Cursor cursor, java.awt.Component component)
           
 void setListener(QueryController.Listener l)
           
 void setQuery(Query query)
           
 void setScrollSize(int size)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_ACTIONCOMMAND

public static final java.lang.String SEARCH_ACTIONCOMMAND
See Also:
Constant Field Values

PAGE_UP_ACTIONCOMMAND

public static final java.lang.String PAGE_UP_ACTIONCOMMAND
See Also:
Constant Field Values

PAGE_DOWN_ACTIONCOMMAND

public static final java.lang.String PAGE_DOWN_ACTIONCOMMAND
See Also:
Constant Field Values

_firstRec

protected Record _firstRec

_lastRec

protected Record _lastRec

_scrolling

protected boolean _scrolling
Constructor Detail

QueryController

public QueryController(Query query)
                throws java.lang.Exception
Throws:
java.lang.Exception

QueryController

public QueryController(Query query,
                       boolean scrolling)
                throws java.lang.Exception
Throws:
java.lang.Exception

QueryController

public QueryController()
                throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

setQuery

public void setQuery(Query query)
              throws java.lang.Exception
Throws:
java.lang.Exception

getQuery

public Query getQuery()

setComponent

public void setComponent(java.awt.Component component)

registerFilterPanel

public void registerFilterPanel(FilterPanel panel)

registerFilterGroupPanel

public void registerFilterGroupPanel(FilterGroupPanel panel)

registerSortPanel

public void registerSortPanel(SortPanel panel)

addRecordSelectionListener

public void addRecordSelectionListener(RecordSelectionListener listener)

setScrollSize

public void setScrollSize(int size)

getScrollSize

public int getScrollSize()

registerUpButton

public void registerUpButton(javax.swing.JButton button)

registerDownButton

public void registerDownButton(javax.swing.JButton button)

registerButtonRow

public void registerButtonRow(ButtonRow row)

enableUpButton

public void enableUpButton(boolean enable)

enableDownButton

public void enableDownButton(boolean enable)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

search

public void search(boolean down,
                   boolean first)
            throws java.lang.Exception
Throws:
java.lang.Exception

checkMandatory

protected boolean checkMandatory()
                          throws java.lang.Exception
Throws:
java.lang.Exception

createQueryParams

public QueryParams createQueryParams()
                              throws java.lang.Exception
Throws:
java.lang.Exception

notifyListeners

public void notifyListeners(RecordList recList)
                     throws java.lang.Exception
Throws:
java.lang.Exception

setCursor

protected void setCursor(java.awt.Cursor cursor,
                         java.awt.Component component)

addListener

public void addListener(QueryController.Listener l)

setListener

public void setListener(QueryController.Listener l)

registerStatusBar

public void registerStatusBar(StatusBar bar)

getRecordComparator

public RecordComparator getRecordComparator()
                                     throws java.lang.Exception
Throws:
java.lang.Exception