org.gjt.sp.jedit.search
Class SearchDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--org.gjt.sp.jedit.gui.EnhancedDialog
                                      |
                                      +--org.gjt.sp.jedit.search.SearchDialog
All Implemented Interfaces:
javax.accessibility.Accessible, EBComponent, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class SearchDialog
extends EnhancedDialog
implements EBComponent

Search and replace dialog.

Version:
$Id: SearchDialog.java,v 1.34 2003/02/18 22:03:20 spestov Exp $
Author:
Slava Pestov
See Also:
Serialized Form

Field Summary
static int ALL_BUFFERS
           
static int CURRENT_BUFFER
          Default file set.
static int DIRECTORY
           
 
Fields inherited from class org.gjt.sp.jedit.gui.EnhancedDialog
keyHandler
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SearchDialog(View view, java.lang.String searchString)
          Creates a new search and replace dialog box.
SearchDialog(View view, java.lang.String searchString, int searchIn)
          Creates a new search and replace dialog box.
 
Method Summary
 void cancel()
           
 void dispose()
           
static SearchDialog getSearchDialog(View view)
           
 void handleMessage(EBMessage msg)
          Handles a message sent on the EditBus.
 void ok()
           
 void setSearchString(java.lang.String searchString, int searchIn)
          Sets the search string.
static void showSearchDialog(View view, java.lang.String searchString, int searchIn)
          Displays a search and replace dialog box, reusing an existing one if necessary.
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CURRENT_BUFFER

public static final int CURRENT_BUFFER
Default file set.

Since:
jEdit 3.2pre2
See Also:
Constant Field Values

ALL_BUFFERS

public static final int ALL_BUFFERS
See Also:
Constant Field Values

DIRECTORY

public static final int DIRECTORY
See Also:
Constant Field Values
Constructor Detail

SearchDialog

public SearchDialog(View view,
                    java.lang.String searchString)
Creates a new search and replace dialog box.

Parameters:
view - The view
searchString - The search string

SearchDialog

public SearchDialog(View view,
                    java.lang.String searchString,
                    int searchIn)
Creates a new search and replace dialog box.

Parameters:
view - The view
searchString - The search string
searchIn - One of CURRENT_BUFFER, ALL_BUFFERS, or DIRECTORY
Since:
jEdit 3.2pre2
Method Detail

getSearchDialog

public static SearchDialog getSearchDialog(View view)

showSearchDialog

public static void showSearchDialog(View view,
                                    java.lang.String searchString,
                                    int searchIn)
Displays a search and replace dialog box, reusing an existing one if necessary.

Parameters:
view - The view
searchString - The search string
searchIn - One of CURRENT_BUFFER, ALL_BUFFERS, or DIRECTORY
Since:
jEdit 4.0pre6

setSearchString

public void setSearchString(java.lang.String searchString,
                            int searchIn)
Sets the search string.

Since:
jEdit 4.0pre5

ok

public void ok()
Specified by:
ok in class EnhancedDialog

cancel

public void cancel()
Specified by:
cancel in class EnhancedDialog

handleMessage

public void handleMessage(EBMessage msg)
Description copied from interface: EBComponent
Handles a message sent on the EditBus. This method must specify the type of responses the plugin will have for various subclasses of the EBMessage class. Typically this is done with one or more if blocks that test whether the message is an instance of a derived message class in which the component has an interest. For example:
 if(msg instanceof BufferUpdate) {
     // a buffer's state has changed!
 }
 else if(msg instanceof ViewUpdate) {
     // a view's state has changed!
 }
 // ... and so on

Specified by:
handleMessage in interface EBComponent
Parameters:
msg - The message

dispose

public void dispose()
Overrides:
dispose in class java.awt.Dialog