Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.gjt.sp.jedit.search
Class SearchDialog  view SearchDialog download SearchDialog.java

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

public class SearchDialog
extends org.gjt.sp.jedit.gui.EnhancedDialog
implements org.gjt.sp.jedit.EBComponent

Search and replace dialog.

Version:
$Id: SearchDialog.java,v 1.50 2003/11/30 04:22:52 spestov Exp $

Nested Class Summary
(package private)  class SearchDialog.ButtonActionHandler
           
(package private)  class SearchDialog.MultiFileActionHandler
           
(package private)  class SearchDialog.MyJRadioButton
           
(package private)  class SearchDialog.ReplaceActionHandler
           
(package private)  class SearchDialog.SettingsActionHandler
           
 
Nested classes inherited from class org.gjt.sp.jedit.gui.EnhancedDialog
 
Nested classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Nested classes inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int ALL_BUFFERS
           
private  javax.swing.JRadioButton beanShellReplace
           
private  javax.swing.JButton choose
           
private  javax.swing.JButton closeBtn
           
static int CURRENT_BUFFER
          Default file set.
private  org.gjt.sp.jedit.gui.HistoryTextField directory
           
static int DIRECTORY
           
private  org.gjt.sp.jedit.gui.HistoryTextField filter
           
private  org.gjt.sp.jedit.gui.HistoryTextField find
           
private  javax.swing.JButton findBtn
           
private  javax.swing.JCheckBox hyperSearch
           
private  javax.swing.JCheckBox ignoreCase
           
private  javax.swing.JCheckBox keepDialog
           
private  javax.swing.JCheckBox regexp
           
private  org.gjt.sp.jedit.gui.HistoryTextField replace
           
private  javax.swing.JButton replaceAllBtn
           
private  javax.swing.JButton replaceAndFindBtn
           
private  boolean saving
           
private  javax.swing.JRadioButton searchAllBuffers
           
private  javax.swing.JRadioButton searchBack
           
private  javax.swing.JRadioButton searchCurrentBuffer
           
private  javax.swing.JRadioButton searchDirectory
           
private  javax.swing.JRadioButton searchForward
           
private  javax.swing.JRadioButton searchSelection
           
private  javax.swing.JCheckBox searchSubDirectories
           
private  javax.swing.JRadioButton stringReplace
           
private  javax.swing.JButton synchronize
           
private  org.gjt.sp.jedit.View view
           
private static java.util.HashMap viewHash
           
private  javax.swing.JCheckBox wrap
           
 
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.Dialog
 
Fields inherited from class java.awt.Window
 
Fields inherited from class java.awt.Container
 
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
private SearchDialog(org.gjt.sp.jedit.View view)
          Creates a new search and replace dialog box.
 
Method Summary
 void cancel()
           
private  void closeOrKeepDialog()
           
private  javax.swing.Box createButtonsPanel()
           
private  javax.swing.JPanel createFieldPanel()
           
private  javax.swing.JPanel createMultiFilePanel()
           
private  javax.swing.JPanel createSearchSettingsPanel()
           
 void dispose()
          Disposes the Dialog and then causes show() to return if it is currently blocked.
static SearchDialog getSearchDialog(org.gjt.sp.jedit.View view)
           
 void handleMessage(org.gjt.sp.jedit.EBMessage msg)
          Handles a message sent on the EditBus.
private  void load()
           
 void ok()
           
static void preloadSearchDialog(org.gjt.sp.jedit.View view)
          Preloads the search dialog for the given for so that it can be quickly displayed later.
private  boolean save(boolean cancel)
           
 void setSearchString(java.lang.String searchString, int searchIn)
          Sets the search string.
static void showSearchDialog(org.gjt.sp.jedit.View view, java.lang.String searchString, int searchIn)
          Displays a search and replace dialog box, reusing an existing one if necessary.
private  void synchronizeMultiFileSettings()
           
private  void updateEnabled()
           
 
Methods inherited from class org.gjt.sp.jedit.gui.EnhancedDialog
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getPreferredSize, 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
addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getGraphicsConfiguration, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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

viewHash

private static java.util.HashMap viewHash

view

private org.gjt.sp.jedit.View view

find

private org.gjt.sp.jedit.gui.HistoryTextField find

replace

private org.gjt.sp.jedit.gui.HistoryTextField replace

stringReplace

private javax.swing.JRadioButton stringReplace

beanShellReplace

private javax.swing.JRadioButton beanShellReplace

keepDialog

private javax.swing.JCheckBox keepDialog

ignoreCase

private javax.swing.JCheckBox ignoreCase

regexp

private javax.swing.JCheckBox regexp

hyperSearch

private javax.swing.JCheckBox hyperSearch

wrap

private javax.swing.JCheckBox wrap

searchBack

private javax.swing.JRadioButton searchBack

searchForward

private javax.swing.JRadioButton searchForward

searchSelection

private javax.swing.JRadioButton searchSelection

searchCurrentBuffer

private javax.swing.JRadioButton searchCurrentBuffer

searchAllBuffers

private javax.swing.JRadioButton searchAllBuffers

searchDirectory

private javax.swing.JRadioButton searchDirectory

filter

private org.gjt.sp.jedit.gui.HistoryTextField filter

directory

private org.gjt.sp.jedit.gui.HistoryTextField directory

searchSubDirectories

private javax.swing.JCheckBox searchSubDirectories

choose

private javax.swing.JButton choose

synchronize

private javax.swing.JButton synchronize

findBtn

private javax.swing.JButton findBtn

replaceAndFindBtn

private javax.swing.JButton replaceAndFindBtn

replaceAllBtn

private javax.swing.JButton replaceAllBtn

closeBtn

private javax.swing.JButton closeBtn

saving

private boolean saving
Constructor Detail

SearchDialog

private SearchDialog(org.gjt.sp.jedit.View view)
Creates a new search and replace dialog box.

Method Detail

getSearchDialog

public static SearchDialog getSearchDialog(org.gjt.sp.jedit.View view)

preloadSearchDialog

public static void preloadSearchDialog(org.gjt.sp.jedit.View view)
Preloads the search dialog for the given for so that it can be quickly displayed later.

Since:
jEdit 4.2pre3

showSearchDialog

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

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()

cancel

public void cancel()

handleMessage

public void handleMessage(org.gjt.sp.jedit.EBMessage msg)
Description copied from interface: org.gjt.sp.jedit.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 org.gjt.sp.jedit.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 org.gjt.sp.jedit.EBComponent

dispose

public void dispose()
Description copied from class: java.awt.Dialog
Disposes the Dialog and then causes show() to return if it is currently blocked.


createFieldPanel

private javax.swing.JPanel createFieldPanel()

createSearchSettingsPanel

private javax.swing.JPanel createSearchSettingsPanel()

createMultiFilePanel

private javax.swing.JPanel createMultiFilePanel()

createButtonsPanel

private javax.swing.Box createButtonsPanel()

updateEnabled

private void updateEnabled()

save

private boolean save(boolean cancel)

synchronizeMultiFileSettings

private void synchronizeMultiFileSettings()

closeOrKeepDialog

private void closeOrKeepDialog()

load

private void load()