Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table.search
Class SearchPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.citra.table.search.AbstractSearchPanel
                      extended by com.citra.table.search.SearchPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class SearchPanel
extends AbstractSearchPanel

SearchPanel represents a panel for searching an entire table. The search condition is provided by a string filter.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  JCheckBox caseSensitive
          the case sensitive check box
protected  boolean resetOnKeyInput
          flag that controls whether to reset the search when the text in the search box changes
protected  JTextField searchBox
          the search text box
protected  boolean searchOnKeyInput
          flag that indicates whether to perform a search if a key is typed in the search box
protected  StringFilter stringFilter
          the string filter used for searching
 
Fields inherited from class com.citra.table.search.AbstractSearchPanel
closeButton, findLabel, foundBackgroundColor, foundForegroundColor, highLight, nextButton, notFound, notFoundBackgroundColor, notFoundForegroundColor, prevButton, searchModel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SearchPanel()
          Constructs a SearchPanel.
 
Method Summary
protected  StringFilter createDefaultStringFilter()
          Creates the default string filter.
protected  Search createSearch()
          Creates the search object that will be used to scan the table.
 boolean getResetOnKeyInput()
          Controls whether to reset the search when the text in the search box changes.
 JTextField getSearchBox()
          Returns the search text field.
 boolean getSearchOnKeyInput()
          Determines whether to perform a search if a key is typed in the search box.
 StringFilter getStringFilter()
          Returns the string filter.
 void highLight()
          Searches the whole table in an arbitrary direction.
protected  void initComponents()
          Initializes the components that will be added to the panel.
protected  void makePanel()
          Initializes the panel.
 void next()
          Searches in the forward direction.
 void previous()
          Searches in the backward direction.
protected  void registerListeners()
          Registers listeners for the close, highlight, next and previous buttons.
 void setResetOnKeyInput(boolean resetOnKeyInput)
          Controls whether to reset the search when the text in the search box changes.
 void setSearchOnKeyInput(boolean searchOnKeyInput)
          Determines whether to perform a search if a key is typed in the search box.
 void setStringFilter(StringFilter stringFilter)
          Assigns the string filter.
 
Methods inherited from class com.citra.table.search.AbstractSearchPanel
getCloseButton, getFindLabel, getFoundBackgroundColor, getFoundForegroundColor, getHighLightButton, getNextButton, getNotFoundBackgroundColor, getNotFoundForegroundColor, getNotFoundLabel, getPrevButton, getSearchModel, register, setFoundBackgroundColor, setFoundForegroundColor, setNotFoundBackgroundColor, setNotFoundForegroundColor, unregister
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

searchOnKeyInput

protected boolean searchOnKeyInput
flag that indicates whether to perform a search if a key is typed in the search box


stringFilter

protected StringFilter stringFilter
the string filter used for searching


searchBox

protected JTextField searchBox
the search text box


caseSensitive

protected JCheckBox caseSensitive
the case sensitive check box


resetOnKeyInput

protected boolean resetOnKeyInput
flag that controls whether to reset the search when the text in the search box changes

Constructor Detail

SearchPanel

public SearchPanel()
Constructs a SearchPanel.

Method Detail

createDefaultStringFilter

protected StringFilter createDefaultStringFilter()
Creates the default string filter.

Returns:
the default string filter

createSearch

protected Search createSearch()
Creates the search object that will be used to scan the table.

Returns:
the search to use while scanning

getResetOnKeyInput

public boolean getResetOnKeyInput()
Controls whether to reset the search when the text in the search box changes.

Returns:
true if the search is to be reset, false otherwise

getSearchBox

public JTextField getSearchBox()
Returns the search text field.

Returns:
the search text field

getSearchOnKeyInput

public boolean getSearchOnKeyInput()
Determines whether to perform a search if a key is typed in the search box.

Returns:
true to search upon key input, false otherwise

getStringFilter

public StringFilter getStringFilter()
Returns the string filter.

Returns:
the string filter

highLight

public void highLight()
Searches the whole table in an arbitrary direction.

Specified by:
highLight in class AbstractSearchPanel

initComponents

protected void initComponents()
Initializes the components that will be added to the panel.

Overrides:
initComponents in class AbstractSearchPanel

makePanel

protected void makePanel()
Initializes the panel.

Specified by:
makePanel in class AbstractSearchPanel

next

public void next()
Searches in the forward direction.

Specified by:
next in class AbstractSearchPanel

previous

public void previous()
Searches in the backward direction.

Specified by:
previous in class AbstractSearchPanel

registerListeners

protected void registerListeners()
Registers listeners for the close, highlight, next and previous buttons.

Overrides:
registerListeners in class AbstractSearchPanel

setResetOnKeyInput

public void setResetOnKeyInput(boolean resetOnKeyInput)
Controls whether to reset the search when the text in the search box changes.

Parameters:
resetOnKeyInput - true if the search is to be reset, false otherwise

setSearchOnKeyInput

public void setSearchOnKeyInput(boolean searchOnKeyInput)
Determines whether to perform a search if a key is typed in the search box.

Parameters:
searchOnKeyInput - true to search upon key input, false otherwise

setStringFilter

public void setStringFilter(StringFilter stringFilter)
Assigns the string filter.

Parameters:
stringFilter - the string filter to assign

Copyright © 2011 Citra Technologies. All Rights Reserved.