|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.rice.cs.drjava.ui.TabbedPanel
edu.rice.cs.drjava.ui.FindReplacePanel
class FindReplacePanel
The tabbed panel that handles requests for finding and replacing text.
| 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
private boolean |
_caretChanged
|
private CaretListener |
_caretListener
Listens for changes to the cursor position in order to reset the start position |
private DefinitionsPane |
_defPane
|
private Action |
_doFindAction
|
private Action |
_findAllAction
|
private JButton |
_findAllButton
|
private JTextPane |
_findField
|
private JLabel |
_findLabelBot
|
(package private) Action |
_findNextAction
The action performed when searching forwards |
private JButton |
_findNextButton
|
(package private) Action |
_findPreviousAction
|
private JButton |
_findPreviousButton
|
private JCheckBox |
_ignoreCommentsAndStrings
|
private JCheckBox |
_ignoreTestCases
|
private boolean |
_isFindReplaceActive
|
private FindReplaceMachine |
_machine
|
private JCheckBox |
_matchCase
|
private JCheckBox |
_matchWholeWord
|
private SingleDisplayModel |
_model
|
(package private) Action |
_replaceAction
|
private Action |
_replaceAllAction
Replaces all occurences of the findfield text with that of the replacefield text both before and after the cursor without prompting for wrapping around the end of the document. |
private JButton |
_replaceAllButton
|
private JButton |
_replaceButton
|
private JTextPane |
_replaceField
|
(package private) Action |
_replaceFindNextAction
|
private JButton |
_replaceFindNextButton
|
(package private) Action |
_replaceFindPreviousAction
|
private JButton |
_replaceFindPreviousButton
|
private JCheckBox |
_searchAllDocuments
|
private JCheckBox |
_searchSelectionOnly
|
(package private) Action |
_standardNewlineAction
|
(package private) Action |
copyAction
Default copy action. |
(package private) Action |
cutAction
Default cut action. |
static char |
LEFT
|
static char |
RIGHT
|
| Fields inherited from class edu.rice.cs.drjava.ui.TabbedPanel |
|---|
_closeButton, _closePanel, _displayed, _frame, _mainPanel, dropTarget |
| 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 | |
|---|---|
FindReplacePanel(MainFrame frame,
SingleDisplayModel model)
Standard Constructor. |
|
| Method Summary | |
|---|---|
protected void |
_close()
Visibly closes the panel and removes it from the frame. |
private void |
_doFind()
Abstracted out since this is called from findNext and findPrevious. |
private void |
_findAll()
Performs "find all" command. |
private void |
_replace()
|
private void |
_replaceAll()
Performs the "replace all" command. |
private void |
_replaceFindNext()
|
private void |
_replaceFindPrevious()
|
private void |
_selectFoundOrReplacedItem(int length)
This method is used to select the item that has been inserted in a replacement. |
private void |
_selectFoundOrReplacedItem(int from,
int to)
Will select the identified text (from, to). |
private void |
_updateMachine()
Sets appropriate variables in the FindReplaceMachine if the caret has been changed. |
(package private) void |
beginListeningTo(DefinitionsPane defPane)
Called from MainFrame in response to opening this or changes in the active document. |
void |
findAll(String searchStr,
boolean searchAll,
boolean searchSelectionOnly,
boolean matchCase,
boolean wholeWord,
boolean noComments,
boolean noTestCases,
OpenDefinitionsDocument startDoc,
RegionManager<MovingDocumentRegion> rm,
MovingDocumentRegion region,
FindResultsPanel panel)
Performs "find all" with the specified options. |
(package private) void |
findNext()
Performs the "find next" command. |
(package private) void |
findPrevious()
Called when user the activates "find previous" command. |
DefinitionsPane |
getDefPane()
METHODS FOR TESTING PURPOSES ONLY |
(package private) JTextPane |
getFindField()
Getter method for the _findField component |
JButton |
getFindNextButton()
|
boolean |
isFindReplaceActive()
|
boolean |
isSearchBackwards()
|
void |
lostOwnership(Clipboard clipboard,
Transferable contents)
We lost ownership of what we put in the clipboard. |
boolean |
requestFocusInWindow()
Focuses the find/replace dialog in the window, placing the focus on the _findField, and selecting all the text. |
void |
setFieldFont(Font f)
Sets the font of the find and replace fields to f. |
void |
setSearchBackwards(boolean b)
|
void |
stopListening()
Called from MainFrame upon closing this Dialog or changes in the active document. |
void |
updateFirstDocInSearch()
Updates the first document where the current all-document search began (called in two places: either when the _findField is updated, or when the user changes documents. |
| Methods inherited from class edu.rice.cs.drjava.ui.TabbedPanel |
|---|
addCloseListener, dragEnter, dragExit, dragOver, drop, dropActionChanged, getMainPanel, getName, isDisplayed, setDisplayed, setVisible |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final char LEFT
public static final char RIGHT
private JButton _findNextButton
private JButton _findPreviousButton
private JButton _findAllButton
private JButton _replaceButton
private JButton _replaceFindNextButton
private JButton _replaceFindPreviousButton
private JButton _replaceAllButton
private JTextPane _findField
private JTextPane _replaceField
private JLabel _findLabelBot
private JCheckBox _ignoreCommentsAndStrings
private JCheckBox _matchCase
private JCheckBox _searchAllDocuments
private JCheckBox _matchWholeWord
private JCheckBox _ignoreTestCases
private JCheckBox _searchSelectionOnly
private FindReplaceMachine _machine
private SingleDisplayModel _model
private DefinitionsPane _defPane
private boolean _caretChanged
private boolean _isFindReplaceActive
private CaretListener _caretListener
Action _findNextAction
Action _findPreviousAction
private Action _findAllAction
private Action _doFindAction
Action _replaceAction
Action _replaceFindNextAction
Action _replaceFindPreviousAction
private Action _replaceAllAction
Action _standardNewlineAction
Action cutAction
Action copyAction
| Constructor Detail |
|---|
public FindReplacePanel(MainFrame frame,
SingleDisplayModel model)
frame - the overall enclosing windowmodel - the model containing the documents to search| Method Detail |
|---|
public boolean isFindReplaceActive()
public boolean requestFocusInWindow()
requestFocusInWindow in class TabbedPanelJTextPane getFindField()
private void _findAll()
public void findAll(String searchStr,
boolean searchAll,
boolean searchSelectionOnly,
boolean matchCase,
boolean wholeWord,
boolean noComments,
boolean noTestCases,
OpenDefinitionsDocument startDoc,
RegionManager<MovingDocumentRegion> rm,
MovingDocumentRegion region,
FindResultsPanel panel)
private void _replaceAll()
private void _replaceFindNext()
private void _replaceFindPrevious()
void findNext()
void findPrevious()
private void _replace()
void beginListeningTo(DefinitionsPane defPane)
public void stopListening()
private void _doFind()
protected void _close()
TabbedPanel
_close in class TabbedPanelpublic void setSearchBackwards(boolean b)
public boolean isSearchBackwards()
public void setFieldFont(Font f)
public void updateFirstDocInSearch()
private void _updateMachine()
private void _selectFoundOrReplacedItem(int length)
private void _selectFoundOrReplacedItem(int from,
int to)
public void lostOwnership(Clipboard clipboard,
Transferable contents)
lostOwnership in interface ClipboardOwnerpublic DefinitionsPane getDefPane()
public JButton getFindNextButton()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||