com.jgoodies.bookfinder.model
Class SearchModel

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by com.jgoodies.bookfinder.model.SearchModel
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, Serializable

public final class SearchModel
extends com.jgoodies.binding.beans.Model

Provides bound Bean properties and search actions: keywords, an author, a keywords-search action, and an author-search action.

As an alternative to the bound Bean properties, we could implement the author and keywords model using two ValueHolders. I favor bound Bean properties, because it allows to perform additional operations in the getter and setter. Here we trim the strings before we set them.

Version:
$Revision: 1.9 $
Author:
Karsten Lentzsch
See Also:
Serialized Form

Field Summary
static String ACTION_FIND_BY_AUTHOR
           
static String ACTION_FIND_BY_KEYWORDS
           
static String PROPERTYNAME_AUTHOR
           
static String PROPERTYNAME_KEYWORDS
           
 
Method Summary
 void findByAuthor()
          Searches and retrieves a SearchResult for the author.
 void findByKeywords()
          Searches and retrieves a SearchResult for the keywords.
 String getAuthor()
          Returns the author used for the author search.
 String getKeywords()
          Returns the keywords used for the keywords search.
 void setAuthor(String newUntrimmedAuthor)
          Sets a new author to be searched for.
 void setKeywords(String newUntrimmedKeywords)
          Sets a new keywords to be searched for.
 
Methods inherited from class com.jgoodies.binding.beans.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTYNAME_AUTHOR

public static final String PROPERTYNAME_AUTHOR
See Also:
Constant Field Values

PROPERTYNAME_KEYWORDS

public static final String PROPERTYNAME_KEYWORDS
See Also:
Constant Field Values

ACTION_FIND_BY_KEYWORDS

public static final String ACTION_FIND_BY_KEYWORDS
See Also:
Constant Field Values

ACTION_FIND_BY_AUTHOR

public static final String ACTION_FIND_BY_AUTHOR
See Also:
Constant Field Values
Method Detail

getAuthor

public String getAuthor()
Returns the author used for the author search.

Returns:
the author used for the author search.

setAuthor

public void setAuthor(String newUntrimmedAuthor)
Sets a new author to be searched for. The author string will be trimmed before it is set as new value.

Parameters:
newUntrimmedAuthor - the author to be set, will be trimmed

getKeywords

public String getKeywords()
Returns the keywords used for the keywords search.

Returns:
the keywords used for the keywords search.

setKeywords

public void setKeywords(String newUntrimmedKeywords)
Sets a new keywords to be searched for. The keywords string will be trimmed before it is set as new value.

Parameters:
newUntrimmedKeywords - the author to be set, will be trimmed

findByKeywords

@Action
public void findByKeywords()
Searches and retrieves a SearchResult for the keywords.


findByAuthor

@Action
public void findByAuthor()
Searches and retrieves a SearchResult for the author.



Copyright © 2002-2008 JGoodies Karsten Lentzsch. All Rights Reserved.