|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jidesoft.editor.CodeEditorFindAndReplaceTarget
com.jidesoft.editor.CodeEditorSelectionFindAndReplaceTarget
public class CodeEditorSelectionFindAndReplaceTarget
A FindAndReplaceTarget implementation for the selection in CodeEditor.
| Constructor Summary | |
|---|---|
CodeEditorSelectionFindAndReplaceTarget(CodeEditor codeEditor)
|
|
| Method Summary | |
|---|---|
void |
adjustCurrentPosition(String searchingText,
boolean forward)
Adjusts current position according to searching text in the first attempt to search. |
JComponent |
getConfigurationPanel()
FindAndReplaceTarget can be added to FindAndReplacePanel so that user can configure it. |
int |
getCurrentPosition(boolean forward)
Gets the current position where the next search will start. |
CharSequence |
getCurrentText()
Gets the current text. |
Color |
getHighlightColor()
Gets the highlight color. |
boolean |
hasHighlight()
|
void |
highlight(int start,
int end)
Highlights the text to indicate the text matches the searching criteria. |
void |
propertyChange(PropertyChangeEvent evt)
|
void |
replace(int offset,
int len,
String str)
Replaces some text with the new text. |
void |
replaceAllEnds()
Replace all ends. |
void |
replaceAllStarts()
Replace all starts. |
void |
selectionChanged(SelectionEvent e)
Called when selection changed. |
void |
setHighlightColor(Color highlightColor)
Changes the highlight color. |
| Methods inherited from class com.jidesoft.editor.CodeEditorFindAndReplaceTarget |
|---|
changedUpdate, getCodeEditor, getCurrentName, getIntepreter, getLocale, getPromptDialogLocation, getPromptDialogLocation, getPromptDialogParent, getResourceString, hasNext, hasPrevious, insertUpdate, isTargetChanged, next, previous, removeUpdate, scrollToShowCaret, setTargetChanged, showMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CodeEditorSelectionFindAndReplaceTarget(CodeEditor codeEditor)
| Method Detail |
|---|
public Color getHighlightColor()
public void setHighlightColor(Color highlightColor)
highlightColor - the highlight colorpublic CharSequence getCurrentText()
FindAndReplaceTarget
getCurrentText in interface FindAndReplaceTargetgetCurrentText in class CodeEditorFindAndReplaceTargetpublic JComponent getConfigurationPanel()
FindAndReplaceTargetFindAndReplaceTarget can be added to FindAndReplacePanel so that user can configure it.
The panel returned from this method is the panel. FindAndReplacePanel will add a radio button before
the configuration panel, so there is no need to have a radio button inside the panel. If there is nothing to
configure for this target, you just return a JLabel with the descriptive name. For example, something like new
JLabel("Selection") if the target is for the selected text in a CodeEditor.
FindAndReplacePanel will arrange all configuration panels vertically, so you should make sure the
configuration panel are arranged horizontally (very wide instead very tall) so that the overall appearance looks
good. If for whatever reason you have to make the configuration very tall, you may need to override FindAndReplacePanel.createTargetPanel() method so that you can do the layout of the configuration panels
yourself.
getConfigurationPanel in interface FindAndReplaceTargetgetConfigurationPanel in class CodeEditorFindAndReplaceTargetpublic boolean hasHighlight()
public void replace(int offset,
int len,
String str)
throws BadLocationException
FindAndReplaceTarget
replace in interface FindAndReplaceTargetreplace in class CodeEditorFindAndReplaceTargetoffset - the offset from the beginning.len - the number of characters to be replaced.str - the new text to replace the old text.
BadLocationException - if the given offset is not a valid position within the document
public void adjustCurrentPosition(String searchingText,
boolean forward)
FindAndReplaceTarget
adjustCurrentPosition in interface FindAndReplaceTargetadjustCurrentPosition in class CodeEditorFindAndReplaceTargetsearchingText - current searching textforward - true or false.
public void highlight(int start,
int end)
FindAndReplaceTarget
highlight in interface FindAndReplaceTargethighlight in class CodeEditorFindAndReplaceTargetstart - the start offset of the text that is found.end - the end offset of the text that is found.public int getCurrentPosition(boolean forward)
FindAndReplaceTarget
getCurrentPosition in interface FindAndReplaceTargetgetCurrentPosition in class CodeEditorFindAndReplaceTargetforward - true or false.
public void selectionChanged(SelectionEvent e)
SelectionListener
selectionChanged in interface SelectionListenerpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerpublic void replaceAllStarts()
FindAndReplaceTarget
replaceAllStarts in interface FindAndReplaceTargetreplaceAllStarts in class CodeEditorFindAndReplaceTargetpublic void replaceAllEnds()
FindAndReplaceTarget
replaceAllEnds in interface FindAndReplaceTargetreplaceAllEnds in class CodeEditorFindAndReplaceTarget
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||