butler.client.query
Class DQueryPanel

java.lang.Object
  extended by butler.client.query.DQueryPanel

public class DQueryPanel
extends java.lang.Object

Panel for entering values for filters. The filters can be grouped in different groups, if needed. Sort order may also be choosen.

Author:
Fredrik Bertilsson

Field Summary
static int BORDERFRAME_LAYOUT
           
static int TABBEDPANE_LAYOUT
           
 
Constructor Summary
DQueryPanel(Query query)
          Constructs a query panel based on the given query.
 
Method Summary
 void addFilterGroupPanel(DFilterGroupPanel p)
          Adds a groups of filter panels.
 DFilterGroupPanel createFilterGroupPanel()
           
 DFilterGroupPanel getFilterGroupPanel(java.lang.String id)
           
 java.util.List getFilterGroupPanels()
           
 int getLayout()
           
 Orientation getOrientation()
           
 java.awt.Dimension getPreferredButtonSize()
           
 Query getQuery()
           
 java.lang.String getSearchButtonCaption()
          Gets the search button's caption
 DSortPanel getSortPanel()
           
static DQueryPanel parse(org.dom4j.Element element)
           
 void registerRecordSelector(ForeignKeyFilter fk, DRecordSelector selector)
           
 void setLayout(int layout)
           
 void setOrientation(Orientation orientation)
          Sets the orientation (HORIZONTAL/VERTICAL) on the layout of the components.
 void setPreferredButtonSize(java.awt.Dimension size)
           
 void setQuery(Query q)
           
 void setSearchButtonCaption(java.lang.String caption)
          Sets the search button's new caption
 void setShowCloseButton(boolean flag)
          Tells if close button should be used.
 void setShowPagingButtons(boolean flag)
          Tells if paging buttons should be used.
 void setSortPanel(DSortPanel sortPanel)
          Sets the sort panel to use.
 void setUsePaging(boolean flag)
          Tells if paging should be used.
 boolean showCloseButton()
           
 boolean showPagingButtons()
           
 void toXML(org.xml.sax.ContentHandler handler)
           
 boolean usePaging()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TABBEDPANE_LAYOUT

public static final int TABBEDPANE_LAYOUT
See Also:
Constant Field Values

BORDERFRAME_LAYOUT

public static final int BORDERFRAME_LAYOUT
See Also:
Constant Field Values
Constructor Detail

DQueryPanel

public DQueryPanel(Query query)
            throws java.lang.Exception
Constructs a query panel based on the given query. The GUI will be automatically build based on the query.

Throws:
java.lang.Exception
Method Detail

getQuery

public Query getQuery()

setQuery

public void setQuery(Query q)

setUsePaging

public void setUsePaging(boolean flag)
Tells if paging should be used.


usePaging

public boolean usePaging()

setShowPagingButtons

public void setShowPagingButtons(boolean flag)
Tells if paging buttons should be used.


showPagingButtons

public boolean showPagingButtons()

setOrientation

public void setOrientation(Orientation orientation)
Sets the orientation (HORIZONTAL/VERTICAL) on the layout of the components.


getOrientation

public Orientation getOrientation()

setPreferredButtonSize

public void setPreferredButtonSize(java.awt.Dimension size)

getPreferredButtonSize

public java.awt.Dimension getPreferredButtonSize()

addFilterGroupPanel

public void addFilterGroupPanel(DFilterGroupPanel p)
Adds a groups of filter panels.


createFilterGroupPanel

public DFilterGroupPanel createFilterGroupPanel()

getFilterGroupPanels

public java.util.List getFilterGroupPanels()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getFilterGroupPanel

public DFilterGroupPanel getFilterGroupPanel(java.lang.String id)

getSortPanel

public DSortPanel getSortPanel()

setSortPanel

public void setSortPanel(DSortPanel sortPanel)
Sets the sort panel to use.


parse

public static DQueryPanel parse(org.dom4j.Element element)
                         throws java.lang.Exception
Throws:
java.lang.Exception

toXML

public void toXML(org.xml.sax.ContentHandler handler)
           throws java.lang.Exception
Throws:
java.lang.Exception

getLayout

public int getLayout()

setLayout

public void setLayout(int layout)

registerRecordSelector

public void registerRecordSelector(ForeignKeyFilter fk,
                                   DRecordSelector selector)
                            throws java.lang.Exception
Throws:
java.lang.Exception

setShowCloseButton

public void setShowCloseButton(boolean flag)
Tells if close button should be used.


showCloseButton

public boolean showCloseButton()

setSearchButtonCaption

public void setSearchButtonCaption(java.lang.String caption)
Sets the search button's new caption


getSearchButtonCaption

public java.lang.String getSearchButtonCaption()
Gets the search button's caption