org.fife.ui.search
Class ReplaceInFilesDialog

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.fife.ui.EscapableDialog
                          extended byorg.fife.ui.search.AbstractSearchDialog
                              extended byorg.fife.ui.search.FindInFilesDialog
                                  extended byorg.fife.ui.search.ReplaceInFilesDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class ReplaceInFilesDialog
extends FindInFilesDialog

Dialog that does string replacement across multiple files.

Version:
0.8
Author:
Robert Futrell
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.fife.ui.search.AbstractSearchDialog
AbstractSearchDialog.EnableResult
 
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
protected  MaxWidthComboBox replaceCombo
           
 
Fields inherited from class org.fife.ui.search.FindInFilesDialog
findButton, inFilesComboBox, inFolderTextField, SEARCH_STRINGS_PROPERTY, subfoldersCheckBox, verboseCheckBox
 
Fields inherited from class org.fife.ui.search.AbstractSearchDialog
cancelButton, caseCheckBox, findTextCombo, MATCH_CASE_PROPERTY, MATCH_WHOLE_WORD_PROPERTY, regExpCheckBox, searchConditionsPanel, USE_REG_EX_PROPERTY, wholeWordCheckBox
 
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
ReplaceInFilesDialog(java.awt.Frame owner)
          Creates a new ReplaceInFilesDialog.
ReplaceInFilesDialog(java.awt.Frame owner, java.util.ResourceBundle msg)
          Creates a new ReplaceInFilesDialog.
 
Method Summary
protected  javax.swing.JPanel createDetailsPanel(java.util.ResourceBundle msg)
          Creates the panel containing "Report Detail" options.
protected  javax.swing.JPanel createExtraOptionsPanel(java.util.ResourceBundle msg)
          Returns a panel containing any extra options, such as a "verbose" output option.
protected  javax.swing.JPanel createInputPanel(java.util.ResourceBundle msg)
          Creates and returns the panel containing input fields and their labels.
protected  org.fife.ui.search.ResultsComponent createResultsComponent()
          Creates and returns the component used to display search results.
protected  org.fife.ui.search.FindInFilesThread createWorkerThread(java.io.File directory)
          Returns the thread that will do the searching.
protected  void escapePressed()
          Called when the Escape key is pressed in this dialog.
 java.lang.String getReplaceString()
          Returns the text to replace with.
protected  void handleRegExCheckBoxClicked()
          Called when the regex checkbox is clicked.
protected  void setSearching(boolean searching)
          Enables or disables widgets in the dialog as appropriate.
 void setVisible(boolean visible)
          Displays or hides the Find in Files dialog. Note that you should use this method and not show() to properly display this dialog.
 
Methods inherited from class org.fife.ui.search.FindInFilesDialog
actionPerformed, addFindInFilesListener, addInFilesComboBoxFilter, fireFindInFilesEvent, getLength, getResultsComponent, getSearchStrings, getWorkerThread, handleToggleButtons, isEverythingFilledIn, removeFindInFilesListener, setSearchParameters, setSearchParameters, setSearchString, setStatusText, updateUI
 
Methods inherited from class org.fife.ui.search.AbstractSearchDialog
createSearchComboBox, createTitledBorder, getCancelButtonText, getContentAssistImage, getMatchCaseCheckboxText, getRegularExpressionCheckboxText, getSearchString, getTextComponent, getWholeWordCheckboxText, isPreJava6JRE, isWholeWord, setCancelButtonText, setMatchCaseCheckboxText, setRegularExpressionCheckboxText, setWholeWordCheckboxText
 
Methods inherited from class org.fife.ui.EscapableDialog
setEscapeClosesDialog
 
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, dispose, 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, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

replaceCombo

protected MaxWidthComboBox replaceCombo
Constructor Detail

ReplaceInFilesDialog

public ReplaceInFilesDialog(java.awt.Frame owner)
Creates a new ReplaceInFilesDialog.

Parameters:
owner - The main window that owns this dialog.

ReplaceInFilesDialog

public ReplaceInFilesDialog(java.awt.Frame owner,
                            java.util.ResourceBundle msg)
Creates a new ReplaceInFilesDialog.

Parameters:
owner - The owner of this dialog.
msg - The resource bundle.
Method Detail

createDetailsPanel

protected javax.swing.JPanel createDetailsPanel(java.util.ResourceBundle msg)
Creates the panel containing "Report Detail" options.

Overrides:
createDetailsPanel in class FindInFilesDialog
Parameters:
msg - The resource bundle.
Returns:
The panel.

createExtraOptionsPanel

protected javax.swing.JPanel createExtraOptionsPanel(java.util.ResourceBundle msg)
Returns a panel containing any extra options, such as a "verbose" output option.

Overrides:
createExtraOptionsPanel in class FindInFilesDialog
Parameters:
msg - The resource bundle.
Returns:
The panel, or null if there are no extra options.

createInputPanel

protected javax.swing.JPanel createInputPanel(java.util.ResourceBundle msg)
Creates and returns the panel containing input fields and their labels.

Overrides:
createInputPanel in class FindInFilesDialog
Parameters:
msg - The resource bundle.
Returns:
The panel.

createResultsComponent

protected org.fife.ui.search.ResultsComponent createResultsComponent()
Creates and returns the component used to display search results.

Overrides:
createResultsComponent in class FindInFilesDialog
Returns:
The component.

createWorkerThread

protected org.fife.ui.search.FindInFilesThread createWorkerThread(java.io.File directory)
Returns the thread that will do the searching.

Overrides:
createWorkerThread in class FindInFilesDialog
Parameters:
directory - The directory to search in.
Returns:
The thread.

escapePressed

protected void escapePressed()
Description copied from class: EscapableDialog
Called when the Escape key is pressed in this dialog. Subclasses can override to handle any custom "Cancel" logic. The default implementation hides the dialog (via setVisible(false);).

Overrides:
escapePressed in class AbstractSearchDialog

getReplaceString

public java.lang.String getReplaceString()
Returns the text to replace with.

Returns:
The text the user wants to replace with.

handleRegExCheckBoxClicked

protected void handleRegExCheckBoxClicked()
Called when the regex checkbox is clicked.

Overrides:
handleRegExCheckBoxClicked in class AbstractSearchDialog

setSearching

protected void setSearching(boolean searching)
Enables or disables widgets in the dialog as appropriate.

Overrides:
setSearching in class FindInFilesDialog
Parameters:
searching - Whether searching is starting.

setVisible

public void setVisible(boolean visible)
Displays or hides the Find in Files dialog. Note that you should use this method and not show() to properly display this dialog.

Overrides:
setVisible in class FindInFilesDialog
Parameters:
visible - Whether the dialog should be displayed or hidden.