org.jminor.common.ui.textfield
Class SearchFieldHint

java.lang.Object
  extended by org.jminor.common.ui.textfield.SearchFieldHint

public final class SearchFieldHint
extends Object

Implements a search hint for text fields, that is, text that is shown when the field is empty an unfocused.


Constructor Summary
SearchFieldHint(JTextField txtField)
          Instantiates a new SearchFieldHint for the given field.
SearchFieldHint(JTextField txtField, String searchHint)
          Instantiates a new SearchFieldHint for the given field.
 
Method Summary
static SearchFieldHint enable(JTextField txtField)
          Enables the search hint for the given field
static SearchFieldHint enable(JTextField txtField, String searchHint)
          Enables the search hint for the given field
 String getSearchHint()
           
 boolean isHintVisible()
           
 void updateState()
          Updates the hint state for the component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchFieldHint

public SearchFieldHint(JTextField txtField)
Instantiates a new SearchFieldHint for the given field.

Parameters:
txtField - the text field

SearchFieldHint

public SearchFieldHint(JTextField txtField,
                       String searchHint)
Instantiates a new SearchFieldHint for the given field.

Parameters:
txtField - the text field
searchHint - the search hint
Method Detail

getSearchHint

public String getSearchHint()
Returns:
the search hint string

updateState

public void updateState()
Updates the hint state for the component


isHintVisible

public boolean isHintVisible()
Returns:
true if the hint is visible

enable

public static SearchFieldHint enable(JTextField txtField)
Enables the search hint for the given field

Parameters:
txtField - the text field
Returns:
the SearchFieldHint instance

enable

public static SearchFieldHint enable(JTextField txtField,
                                     String searchHint)
Enables the search hint for the given field

Parameters:
txtField - the text field
searchHint - the search hint
Returns:
the SearchFieldHint instance