Package com.jidesoft.swing.event
Class SearchableEvent
- java.lang.Object
-
- java.util.EventObject
-
- java.awt.AWTEvent
-
- com.jidesoft.swing.event.SearchableEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class SearchableEvent extends java.awt.AWTEvent
AnAWTEvent
that adds support forSearchableEvent
objects as the event source.- See Also:
Searchable
,SearchableListener
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
SEARCHABLE_CHANGE
To indicate the searching text changes.static int
SEARCHABLE_END
To indicate the searching process stopped.static int
SEARCHABLE_FIRST
The first number in the range of IDs used forSearchableEvent
.static int
SEARCHABLE_LAST
The last number in the range of IDs used forSearchableEvent
.static int
SEARCHABLE_MATCH
To indicate the searching process finds a matching element.static int
SEARCHABLE_MODEL_CHANGE
To indicate the search component model is changed.static int
SEARCHABLE_NOMATCH
To indicate the searching process doesn't find a matching element.static int
SEARCHABLE_START
To indicate the searching process started.-
Fields inherited from class java.awt.AWTEvent
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASK
-
-
Constructor Summary
Constructors Constructor Description SearchableEvent(Searchable source, int id)
Creates aSearchableEvent
.SearchableEvent(java.lang.Object source, int id, java.lang.String searchingText)
Creates aSearchableEvent
.SearchableEvent(java.lang.Object source, int id, java.lang.String searchingText, java.lang.Object matchingObject, java.lang.String matchingText)
SearchableEvent(java.lang.Object source, int id, java.lang.String searchingText, java.lang.String oldSearchingText)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getMatchingObject()
Gets the object that matches the searching text.java.lang.String
getMatchingText()
Gets the text that is converted from the object matching the searching text.java.lang.String
getOldSearchingText()
Gets the text that was searched for.Searchable
getSearchable()
Returns the originator of the event.java.lang.String
getSearchingText()
Gets the text that is being searched for.java.lang.String
paramString()
Returns a parameter string identifying this event.
-
-
-
Field Detail
-
SEARCHABLE_FIRST
public static final int SEARCHABLE_FIRST
The first number in the range of IDs used forSearchableEvent
.- See Also:
- Constant Field Values
-
SEARCHABLE_LAST
public static final int SEARCHABLE_LAST
The last number in the range of IDs used forSearchableEvent
.- See Also:
- Constant Field Values
-
SEARCHABLE_START
public static final int SEARCHABLE_START
To indicate the searching process started. It is fired when the search popup shows up.- See Also:
- Constant Field Values
-
SEARCHABLE_END
public static final int SEARCHABLE_END
To indicate the searching process stopped. It is fired when the search popup is gone.- See Also:
- Constant Field Values
-
SEARCHABLE_MATCH
public static final int SEARCHABLE_MATCH
To indicate the searching process finds a matching element. In this case,getSearchingText()
will return the text that is being searched for.getMatchingObject()
will return the element that matches the searching text.getMatchingText()
is the text converting from the the matching object.- See Also:
- Constant Field Values
-
SEARCHABLE_NOMATCH
public static final int SEARCHABLE_NOMATCH
To indicate the searching process doesn't find a matching element. In this case,getSearchingText()
will return the text that is being searched for.getMatchingObject()
andgetMatchingText()
will be null.- See Also:
- Constant Field Values
-
SEARCHABLE_CHANGE
public static final int SEARCHABLE_CHANGE
To indicate the searching text changes. In this case,getSearchingText()
will return the text that is being searched for.getOldSearchingText()
will return the previous searching text.- See Also:
- Constant Field Values
-
SEARCHABLE_MODEL_CHANGE
public static final int SEARCHABLE_MODEL_CHANGE
To indicate the search component model is changed. The model could be ListModel in the case of JList, TableModel in the case of JTable, etc.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SearchableEvent
public SearchableEvent(Searchable source, int id)
Creates aSearchableEvent
.- Parameters:
source
-id
-
-
SearchableEvent
public SearchableEvent(java.lang.Object source, int id, java.lang.String searchingText)
Creates aSearchableEvent
. The searching text is the text that is being searched for.- Parameters:
source
-id
-searchingText
-
-
SearchableEvent
public SearchableEvent(java.lang.Object source, int id, java.lang.String searchingText, java.lang.String oldSearchingText)
-
SearchableEvent
public SearchableEvent(java.lang.Object source, int id, java.lang.String searchingText, java.lang.Object matchingObject, java.lang.String matchingText)
-
-
Method Detail
-
paramString
public java.lang.String paramString()
Returns a parameter string identifying this event. This method is useful for event logging and for debugging.- Overrides:
paramString
in classjava.awt.AWTEvent
- Returns:
- a string identifying the event and its attributes
-
getSearchable
public Searchable getSearchable()
Returns the originator of the event.- Returns:
- the
Searchable
object that originated the event
-
getSearchingText
public java.lang.String getSearchingText()
Gets the text that is being searched for. The returned value is valid for events SEARCHABLE_START, SEARCHABLE_MATCH, SEARCHABLE_NOMATCH, and SEARCHABLE_CHANGE.- Returns:
- the text that is being searched for.
-
getOldSearchingText
public java.lang.String getOldSearchingText()
Gets the text that was searched for. The returned value is only valid for event SEARCHABLE_CHANGE.- Returns:
- the text that was searched for.
-
getMatchingText
public java.lang.String getMatchingText()
Gets the text that is converted from the object matching the searching text. The returned value is only valid for events SEARCHABLE_MATCH.- Returns:
- the text that is converted from the object matching the searching text.
-
getMatchingObject
public java.lang.Object getMatchingObject()
Gets the object that matches the searching text. The returned value is only valid for events SEARCHABLE_MATCH.- Returns:
- Gets the object that matches the searching text.
-
-