util.ui.findasyoutype
Class TextComponentFindAction
java.lang.Object
javax.swing.AbstractAction
util.ui.findasyoutype.FindAction
util.ui.findasyoutype.TextComponentFindAction
- All Implemented Interfaces:
- ActionListener, ComponentListener, FocusListener, KeyListener, Serializable, Cloneable, Runnable, EventListener, Action, DocumentListener
public class TextComponentFindAction
- extends FindAction
- implements FocusListener, ComponentListener
This TextComponentFindAction is based on the Implementation of Santosh
For Details look here:
http://jroller.com/page/santhosh/20050707#incremental_search_jtextcomponent
- Author:
- Santhosh
Changed for support of a search bar instead of a search popup by René Mach:
- added the needed components for the search bar
- added ComponentListener to initialize the search when the
search bar becomes visible
- added Runnable to support closing the search bar automatically if the
search was started with a key type.
- added Localizer
- added MouseAdapter for the search bar buttons
- See Also:
- Serialized Form
| Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
| Methods inherited from class util.ui.findasyoutype.FindAction |
actionPerformed, changedUpdate, getComponent, getMessageLabel, getSearchField, getThread, getWaitTime, insertUpdate, installKeyListener, isBlockAutoClosing, isIgnoreCase, keyPressed, keyReleased, keyTyped, next, prev, removeUpdate, reset, setBlockAutoClosing, setIgnoreCase, setWaitTime |
TextComponentFindAction
public TextComponentFindAction(JTextComponent comp)
TextComponentFindAction
public TextComponentFindAction(JTextComponent comp,
boolean startAtKeyType)
initSearch
protected void initSearch(ActionEvent ae)
- Overrides:
initSearch in class FindAction
changed
protected boolean changed(JComponent comp,
String str,
Position.Bias bias)
- Specified by:
changed in class FindAction
getNextMatch
protected int getNextMatch(JTextComponent textComp,
String str,
int startingOffset,
Position.Bias bias)
focusGained
public void focusGained(FocusEvent e)
- Specified by:
focusGained in interface FocusListener
focusLost
public void focusLost(FocusEvent e)
- Specified by:
focusLost in interface FocusListener
getTextComponent
public JTextComponent getTextComponent()
componentHidden
public void componentHidden(ComponentEvent e)
- Specified by:
componentHidden in interface ComponentListener
componentMoved
public void componentMoved(ComponentEvent e)
- Specified by:
componentMoved in interface ComponentListener
componentResized
public void componentResized(ComponentEvent e)
- Specified by:
componentResized in interface ComponentListener
componentShown
public void componentShown(ComponentEvent e)
- Specified by:
componentShown in interface ComponentListener
run
public void run()
- Waits for closing of the panel.
- Specified by:
run in interface Runnable
interrupt
public void interrupt()
- Interrupts the closing Thread.
getSearchBar
public JPanel getSearchBar()
- Returns:
- The search bar
showSearchBar
public void showSearchBar()
- Shows the search bar
isAlwaysVisible
public boolean isAlwaysVisible()
- Returns:
- If the search bar isVisible and will not be closed automatically.
getCloseButton
public JButton getCloseButton()
- Returns:
- The close button of the search bar.
TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)