org.ceryle.ui.search
Class KeywordPanel

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 org.ceryle.ui.search.KeywordPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, MessageWriter

public class KeywordPanel
extends JPanel
implements MessageWriter

Extends JPanel providing an embeddable panel for searching beyond the current DocumentView. This includes full text searching of the XNodeStore and optionally directories from the user's filesystem.

Creates a cache of modified and deleted collections and nodes, and runs a low-priority Timer thread to handle incremental changes in the index. These caches are stored to history between sessions.

Since:
JDK1.4
Version:
$Id: KeywordPanel.java,v 1.21 2007-06-20 04:41:24 altheim Exp $
Author:
Murray Altheim
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
static Color COLOR_SELECTED_HIT_BG
          The color used as the background color for selected hits.
protected  ProgressBar m_progress
           
protected  MessageWriter mw
           
 
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
KeywordPanel(MessageWriter msgwriter, SearchTree searchtree)
          Constructor for KeywordPanel with a MessageWriter and SearchTree.
 
Method Summary
 void applyToGraph(boolean colorize)
          Search the indexed directories for the provided search string.
 void buildIndex(boolean createIndex)
          Build the search index(es).
 void cancelIndexing()
          Requests that any currently-running indexers halt any indexing operations.
 boolean clearResults()
          Clear the results list, returning true if they are successfully cleared.
 void deleteIndex()
          Delete any existing index(es).
 SearchService getSearchService()
          Returns the SearchService used by this KeywordPanel.
 void optimizeIndex()
          Optimize the search index(es).
 void search(String queryString)
          Search, using the XNodeFinder.
protected  void setListPreferredSize(Dimension d)
          Sets the preferred size of the list to Dimension d.
 void setSearchInfo(String s)
          Set the search info string to the provided text.
 String writeMessage(int status, String message)
          Passes the content of the String message on to the existing MessageWriter (as this panel and its parent dialog only handle status messages).
 void writeMessage(String message)
          Passes the content of the String message on to the existing MessageWriter (as this panel and its parent dialog only handle status messages).
 void writeStatus(String message)
          Sets the content of the status line to the String message.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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

COLOR_SELECTED_HIT_BG

public static Color COLOR_SELECTED_HIT_BG
The color used as the background color for selected hits.


m_progress

protected ProgressBar m_progress

mw

protected MessageWriter mw
Constructor Detail

KeywordPanel

public KeywordPanel(MessageWriter msgwriter,
                    SearchTree searchtree)
Constructor for KeywordPanel with a MessageWriter and SearchTree.

Method Detail

getSearchService

public SearchService getSearchService()
Returns the SearchService used by this KeywordPanel.


cancelIndexing

public void cancelIndexing()
Requests that any currently-running indexers halt any indexing operations.


setListPreferredSize

protected void setListPreferredSize(Dimension d)
Sets the preferred size of the list to Dimension d.


search

public void search(String queryString)
Search, using the XNodeFinder.


buildIndex

public void buildIndex(boolean createIndex)
Build the search index(es).


optimizeIndex

public void optimizeIndex()
Optimize the search index(es).


deleteIndex

public void deleteIndex()
Delete any existing index(es).


setSearchInfo

public void setSearchInfo(String s)
Set the search info string to the provided text.


writeMessage

public void writeMessage(String message)
Passes the content of the String message on to the existing MessageWriter (as this panel and its parent dialog only handle status messages).

Specified by:
writeMessage in interface MessageWriter

writeMessage

public String writeMessage(int status,
                           String message)
Passes the content of the String message on to the existing MessageWriter (as this panel and its parent dialog only handle status messages).

Specified by:
writeMessage in interface MessageWriter
Returns:
the String value of the message, including any changes made.
See Also:
MessageHandler

writeStatus

public void writeStatus(String message)
Sets the content of the status line to the String message.

Specified by:
writeStatus in interface MessageWriter

clearResults

public boolean clearResults()
Clear the results list, returning true if they are successfully cleared.


applyToGraph

public void applyToGraph(boolean colorize)
Search the indexed directories for the provided search string. If colorize is true, hilights the matching TNodes with their respective SearchHit score color. Otherwise, replaces the result list with the list of matching Topics.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.