public class AbstractSearchDialog extends EscapableDialog implements java.awt.event.ActionListener
javax.swing.JDialog.AccessibleJDialogjava.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityTypejava.awt.Window.AccessibleAWTWindow, java.awt.Window.Type| Modifier and Type | Field and Description |
|---|---|
protected javax.swing.JButton |
cancelButton |
protected javax.swing.JCheckBox |
caseCheckBox |
protected org.fife.ui.rtextarea.SearchContext |
context |
protected SearchComboBox |
findTextCombo
The combo box where the user enters the text for which to search.
|
protected javax.swing.JCheckBox |
regexCheckBox |
protected javax.swing.JPanel |
searchConditionsPanel |
protected javax.swing.JCheckBox |
wholeWordCheckBox |
protected javax.swing.JCheckBox |
wrapCheckBox |
accessibleContext, rootPane, rootPaneCheckingEnabledBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT| Constructor and Description |
|---|
AbstractSearchDialog(java.awt.Dialog owner)
Constructor.
|
AbstractSearchDialog(java.awt.Frame owner)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Listens for actions in this search dialog.
|
protected org.fife.ui.rtextarea.SearchContext |
createDefaultSearchContext()
Returns the default search context to use for this dialog.
|
protected javax.swing.border.Border |
createTitledBorder(java.lang.String title)
Returns a titled border for panels on search dialogs.
|
protected void |
escapePressed()
Called when the Escape key is pressed in this dialog.
|
protected void |
focusFindTextField()
Makes the "Find text" field active.
|
protected java.util.ResourceBundle |
getBundle() |
java.lang.String |
getCancelButtonText()
Returns the text on the Cancel button.
|
static java.awt.Image |
getContentAssistImage()
Returns the image to display beside text components when content assist
is available.
|
java.lang.String |
getMatchCaseCheckboxText()
Returns the text for the "Match Case" check box.
|
java.lang.String |
getRegularExpressionCheckboxText()
Returns the text for the "Regular Expression" check box.
|
org.fife.ui.rtextarea.SearchContext |
getSearchContext()
Returns the search context used by this dialog.
|
java.lang.String |
getSearchString()
Returns the text to search for.
|
static java.lang.String |
getString(java.lang.String key) |
java.lang.String |
getWholeWordCheckboxText()
Returns the text for the "Whole Word" check box.
|
java.lang.String |
getWrapCheckboxText()
Returns the text for the "Wrap" check box.
|
protected void |
handleRegExCheckBoxClicked()
Called when the regex checkbox is clicked (or its value is modified
via a change to the search context).
|
protected void |
handleSearchContextPropertyChanged(java.beans.PropertyChangeEvent e)
Called whenever a property in the search context is modified.
|
protected FindReplaceButtonsEnableResult |
handleToggleButtons()
Returns whether any action-related buttons (Find Next, Replace, etc.)
should be enabled.
|
protected static boolean |
isPreJava6JRE()
Deprecated.
This library no longer supports Java versions earlier
than Java 8. This method is deprecated instead of
removed to avoid a major version bump.
|
static boolean |
isWholeWord(java.lang.CharSequence searchIn,
int offset,
int len)
Returns whether the characters on either side of
substr(searchIn,startPos,startPos+searchStringLength)
are whitespace. |
protected boolean |
matchesSearchFor(java.lang.String text) |
protected void |
refreshUIFromContext()
Initializes the UI in this tool bar from a search context.
|
void |
requestFocus()
Overridden to ensure the "Find text" field gets focused.
|
void |
setCancelButtonText(java.lang.String text)
Sets the text on the Cancel button.
|
void |
setContentAssistImage(java.awt.Image image)
Sets the image to display by this dialog's text fields when content
assistance is available.
|
void |
setMatchCaseCheckboxText(java.lang.String text)
Sets the text for the "Match Case" check box.
|
void |
setRegularExpressionCheckboxText(java.lang.String text)
Sets the text for the "Regular Expression" check box.
|
void |
setSearchContext(org.fife.ui.rtextarea.SearchContext context)
Sets the search context for this dialog.
|
void |
setSearchString(java.lang.String newSearchString)
Sets the
java.lang.String to search for. |
void |
setWholeWordCheckboxText(java.lang.String text)
Sets the text for the "Whole Word" check box.
|
void |
setWrapCheckboxText(java.lang.String text)
Sets the text for the "Wrap" check box.
|
setEscapeClosesDialogaddImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateaddNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBackaddPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFrontadd, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTreeaction, 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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleprotected org.fife.ui.rtextarea.SearchContext context
protected javax.swing.JCheckBox caseCheckBox
protected javax.swing.JCheckBox wholeWordCheckBox
protected javax.swing.JCheckBox regexCheckBox
protected javax.swing.JCheckBox wrapCheckBox
protected javax.swing.JPanel searchConditionsPanel
protected SearchComboBox findTextCombo
protected javax.swing.JButton cancelButton
public AbstractSearchDialog(java.awt.Dialog owner)
owner - The dialog that owns this search dialog.public AbstractSearchDialog(java.awt.Frame owner)
owner - The window that owns this search dialog.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerprotected org.fife.ui.rtextarea.SearchContext createDefaultSearchContext()
protected javax.swing.border.Border createTitledBorder(java.lang.String title)
title - The title for the border.protected void escapePressed()
EscapableDialogsetVisible(false);).escapePressed in class EscapableDialogprotected void focusFindTextField()
protected java.util.ResourceBundle getBundle()
public final java.lang.String getCancelButtonText()
setCancelButtonText(java.lang.String)public static java.awt.Image getContentAssistImage()
public final java.lang.String getMatchCaseCheckboxText()
setMatchCaseCheckboxText(java.lang.String)public final java.lang.String getRegularExpressionCheckboxText()
setRegularExpressionCheckboxText(java.lang.String)public org.fife.ui.rtextarea.SearchContext getSearchContext()
setSearchContext(SearchContext)public java.lang.String getSearchString()
public static java.lang.String getString(java.lang.String key)
public final java.lang.String getWholeWordCheckboxText()
setWholeWordCheckboxText(java.lang.String)public final java.lang.String getWrapCheckboxText()
setWrapCheckboxText(java.lang.String)protected void handleRegExCheckBoxClicked()
protected void handleSearchContextPropertyChanged(java.beans.PropertyChangeEvent e)
e - The property change event fired.protected FindReplaceButtonsEnableResult handleToggleButtons()
protected boolean matchesSearchFor(java.lang.String text)
@Deprecated protected static boolean isPreJava6JRE()
public static boolean isWholeWord(java.lang.CharSequence searchIn,
int offset,
int len)
substr(searchIn,startPos,startPos+searchStringLength)
are whitespace. While this isn't the best definition of "whole word",
it's the one we're going to use for now.searchIn - The text to search in.offset - The offset of the possible word.len - The length of the possible word.protected void refreshUIFromContext()
public void requestFocus()
requestFocus in class java.awt.Componentpublic final void setCancelButtonText(java.lang.String text)
text - The text for the Cancel button.getCancelButtonText()public void setContentAssistImage(java.awt.Image image)
image - The image. If this is null, a default image
(a light bulb) is used). This should be kept small, around
8x8 for standard resolution monitors.public final void setMatchCaseCheckboxText(java.lang.String text)
text - The text for the "Match Case" check box.getMatchCaseCheckboxText()public final void setRegularExpressionCheckboxText(java.lang.String text)
text - The text for the "Regular Expression" check box.getRegularExpressionCheckboxText()public void setSearchContext(org.fife.ui.rtextarea.SearchContext context)
context - The new search context. This cannot be null.getSearchContext()public void setSearchString(java.lang.String newSearchString)
java.lang.String to search for.newSearchString - The string to put into
the search field.public final void setWholeWordCheckboxText(java.lang.String text)
text - The text for the "Whole Word" check box.getWholeWordCheckboxText()public final void setWrapCheckboxText(java.lang.String text)
text - The text for the "Whole Word" check box.getWholeWordCheckboxText()