Class SearchTool

java.lang.Object
  |
  +--SearchTool

public class SearchTool
extends java.lang.Object

This class is an ancilla to the ArborPanel; it takes care of search operations. Once upon a time, everything was monolithic, but I'm taking care to refactor more sensibly. Arboreal (unlike some others!) is a project with a future.

Version:
$2007-04-22 14:35:41 mdh$
Author:
Malcolm D. Hyman

Inner Class Summary
static class SearchTool.JComboBoxPlus
          A JComboBox that stores some state information.
 
Constructor Summary
SearchTool(ArborPanel panel)
           
 
Method Summary
 void displayNextHit()
          Selects the node containing the next hit and makes it visible.
 void findDialog()
          Pops up a "Find" dialog.
 java.lang.String getFindString()
          Returns the search string.
 java.lang.String getLangID()
          Returns the language ID for the current search.
 Language getLanguage()
          Returns the language for the current search.
 int getType()
          Returns the current search type.
 boolean isAccentless()
          Returns true if the search is "accentless," i.e., if diacritics are to be ignored.
 boolean isGlobal()
          Returns true if the find is global (all results displayed in a new ContentRenderFrame.
 boolean isLemmatized()
          Returns true if the search is for lemmatized words (lexemes).
 boolean isOrthNormal()
          Returns true if the orthography should be normalized for the search.
 boolean isRegexSearch()
          Returns true if the current search is for a regular expression.
 void magicFind(java.lang.String findString, java.lang.String lang, ContentOwner owner)
          This method provides an automatic, non-interactive front-end to the find facility; it allows methods in other classes to initiate a search.
 boolean testLangID(java.lang.String lang)
          Tests a given language ID against the identifier and aliases for the current search.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchTool

public SearchTool(ArborPanel panel)
Method Detail

findDialog

public void findDialog()
Pops up a "Find" dialog.

magicFind

public void magicFind(java.lang.String findString,
                      java.lang.String lang,
                      ContentOwner owner)
This method provides an automatic, non-interactive front-end to the find facility; it allows methods in other classes to initiate a search.
Parameters:
findString - string supplied elsewhere
lang - language for search string
owner - the owner of the text text to be searched

getType

public int getType()
Returns the current search type.
Returns:
true if searching for XML elements

getLangID

public java.lang.String getLangID()
Returns the language ID for the current search.
Returns:
language code as per ISO 639

testLangID

public boolean testLangID(java.lang.String lang)
Tests a given language ID against the identifier and aliases for the current search.
Parameters:
lang - language identifier to test
Returns:
true if match

getLanguage

public Language getLanguage()
Returns the language for the current search.
Returns:
language

isRegexSearch

public boolean isRegexSearch()
Returns true if the current search is for a regular expression.
Returns:
true if searching with regex

isOrthNormal

public boolean isOrthNormal()
Returns true if the orthography should be normalized for the search.
Returns:
true if orthographic normalization

isLemmatized

public boolean isLemmatized()
Returns true if the search is for lemmatized words (lexemes).
Returns:
true if lemmatized search

isAccentless

public boolean isAccentless()
Returns true if the search is "accentless," i.e., if diacritics are to be ignored.
Returns:
true if accentless search

isGlobal

public boolean isGlobal()
Returns true if the find is global (all results displayed in a new ContentRenderFrame.
Returns:
true if global find

displayNextHit

public void displayNextHit()
Selects the node containing the next hit and makes it visible. A certain amount of finessing is needed, since what count as nodes for display purposes are not necessarily identical with what count as nodes in terms of the DOM structure.

getFindString

public java.lang.String getFindString()
Returns the search string.
Returns:
search string