Package org.jdesktop.swingx
Class JXEditorPane.DocumentSearchable
java.lang.Object
org.jdesktop.swingx.JXEditorPane.DocumentSearchable
- All Implemented Interfaces:
Searchable
- Enclosing class:
- JXEditorPane
A
Searchable implementation for Documents.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanchecks if the searchString should be interpreted as empty.intSearchsearchStringfrom the beginning of a document.intSearchsearchStringfrom the given position in a document.intSearchsearchStringin the given direction from the some position in a document.intSearch for the pattern from the beginning of the document.intSearch for the pattern from the start index.intSearch for the pattern from the start index.
-
Constructor Details
-
DocumentSearchable
public DocumentSearchable()
-
-
Method Details
-
search
SearchsearchStringfrom the beginning of a document.- Specified by:
searchin interfaceSearchable- Parameters:
searchString-Stringwe should find in a document.- Returns:
- index of matched
Stringor -1 if a match cannot be found.
-
search
SearchsearchStringfrom the given position in a document.- Specified by:
searchin interfaceSearchable- Parameters:
searchString-Stringwe should find in a document.columnIndex- Start position in a document or -1 if we want to search from the beginning.- Returns:
- index of matched
Stringor -1 if a match cannot be found.
-
search
SearchsearchStringin the given direction from the some position in a document.- Specified by:
searchin interfaceSearchable- Parameters:
searchString-Stringwe should find in a document.columnIndex- Start position in a document or -1 if we want to search from the beginning.backward- Indicates search direction, will search from the given position towards the beginning of a document if this parameter istrue.- Returns:
- index of matched
Stringor -1 if a match cannot be found.
-
isEmpty
checks if the searchString should be interpreted as empty. here: returns true if string is null or has zero length. TODO: This should be in a utility class.- Parameters:
searchString- String- Returns:
- true if string is null or has zero length
-
search
Search for the pattern from the beginning of the document.- Specified by:
searchin interfaceSearchable- Parameters:
pattern- Pattern for search- Returns:
- index of matched
Patternor -1 if a match cannot be found.
-
search
Search for the pattern from the start index.- Specified by:
searchin interfaceSearchable- Parameters:
pattern- Pattern for searchstartIndex- starting index of search. If -1 then start from the beginning- Returns:
- index of matched pattern or -1 if a match cannot be found.
-
search
Search for the pattern from the start index.- Specified by:
searchin interfaceSearchable- Parameters:
pattern- Pattern for searchstartIndex- starting index of search. If -1 then start from the beginningbackwards- indicates the direction if true then search is backwards- Returns:
- index of matched pattern or -1 if a match cannot be found.
-