- java.lang.Object
-
- javax.swing.AbstractAction
-
- util.ui.findasyoutype.FindAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.awt.event.KeyListener
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Runnable
,java.util.EventListener
,javax.swing.Action
,javax.swing.event.DocumentListener
- Direct Known Subclasses:
TextComponentFindAction
public abstract class FindAction extends javax.swing.AbstractAction implements javax.swing.event.DocumentListener, java.awt.event.KeyListener, java.lang.Runnable
This TextComponentFindAction is based on the Implementation of Santhosh For Details look here: http://jroller.com/page/santhosh/20050707#incremental_search_the_framework- Author:
- Santhosh Changed for support of a search bar instead of a search popup by René Mach: - added automatically closing Thread - removed Popup because the search field will be in a search bar - removed up and down key for finding matches because of the buttons in the search bar - added message label - added methods for the search bar - removed redundant constructor
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
controlDown
protected boolean
metaDown
protected boolean
shiftDown
-
Constructor Summary
Constructors Constructor Description FindAction(javax.swing.JComponent comp, boolean startAtKeytype)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent ae)
protected abstract boolean
changed(javax.swing.JComponent comp, java.lang.String text, javax.swing.text.Position.Bias bias)
void
changedUpdate(javax.swing.event.DocumentEvent e)
javax.swing.JComponent
getComponent()
protected javax.swing.JLabel
getMessageLabel()
protected javax.swing.JTextField
getSearchField()
protected java.lang.Thread
getThread()
protected int
getWaitTime()
protected void
initSearch(java.awt.event.ActionEvent ae)
void
insertUpdate(javax.swing.event.DocumentEvent e)
void
installKeyListener(java.awt.Component comp)
protected boolean
isBlockAutoClosing()
boolean
isIgnoreCase()
void
keyPressed(java.awt.event.KeyEvent ke)
void
keyReleased(java.awt.event.KeyEvent e)
void
keyTyped(java.awt.event.KeyEvent e)
void
next()
Go to the next matchvoid
prev()
Go to the previous matchvoid
removeUpdate(javax.swing.event.DocumentEvent e)
protected void
reset()
protected void
setBlockAutoClosing(boolean value)
void
setIgnoreCase(boolean ignoreCase)
protected void
setWaitTime(int value)
-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Method Detail
-
setBlockAutoClosing
protected void setBlockAutoClosing(boolean value)
-
isBlockAutoClosing
protected boolean isBlockAutoClosing()
-
getThread
protected java.lang.Thread getThread()
-
getWaitTime
protected int getWaitTime()
-
setWaitTime
protected void setWaitTime(int value)
-
getMessageLabel
protected javax.swing.JLabel getMessageLabel()
-
reset
protected void reset()
-
prev
public void prev()
Go to the previous match
-
next
public void next()
Go to the next match
-
isIgnoreCase
public boolean isIgnoreCase()
-
setIgnoreCase
public void setIgnoreCase(boolean ignoreCase)
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ae)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
initSearch
protected void initSearch(java.awt.event.ActionEvent ae)
-
changed
protected abstract boolean changed(javax.swing.JComponent comp, java.lang.String text, javax.swing.text.Position.Bias bias)
-
insertUpdate
public void insertUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
insertUpdate
in interfacejavax.swing.event.DocumentListener
-
removeUpdate
public void removeUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
removeUpdate
in interfacejavax.swing.event.DocumentListener
-
changedUpdate
public void changedUpdate(javax.swing.event.DocumentEvent e)
- Specified by:
changedUpdate
in interfacejavax.swing.event.DocumentListener
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent ke)
- Specified by:
keyPressed
in interfacejava.awt.event.KeyListener
-
keyTyped
public void keyTyped(java.awt.event.KeyEvent e)
- Specified by:
keyTyped
in interfacejava.awt.event.KeyListener
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
- Specified by:
keyReleased
in interfacejava.awt.event.KeyListener
-
getSearchField
protected javax.swing.JTextField getSearchField()
-
getComponent
public javax.swing.JComponent getComponent()
-
installKeyListener
public void installKeyListener(java.awt.Component comp)
-
-