|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 FindAndReplaceTarget
getCurrentText
in class CodeEditorFindAndReplaceTarget
public JComponent getConfigurationPanel()
FindAndReplaceTarget
FindAndReplaceTarget
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 FindAndReplaceTarget
getConfigurationPanel
in class CodeEditorFindAndReplaceTarget
public boolean hasHighlight()
public void replace(int offset, int len, String str) throws BadLocationException
FindAndReplaceTarget
replace
in interface FindAndReplaceTarget
replace
in class CodeEditorFindAndReplaceTarget
offset
- 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 documentpublic void adjustCurrentPosition(String searchingText, boolean forward)
FindAndReplaceTarget
adjustCurrentPosition
in interface FindAndReplaceTarget
adjustCurrentPosition
in class CodeEditorFindAndReplaceTarget
searchingText
- current searching textforward
- true or false.public void highlight(int start, int end)
FindAndReplaceTarget
highlight
in interface FindAndReplaceTarget
highlight
in class CodeEditorFindAndReplaceTarget
start
- 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 FindAndReplaceTarget
getCurrentPosition
in class CodeEditorFindAndReplaceTarget
forward
- true or false.
public void selectionChanged(SelectionEvent e)
SelectionListener
selectionChanged
in interface SelectionListener
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public void replaceAllStarts()
FindAndReplaceTarget
replaceAllStarts
in interface FindAndReplaceTarget
replaceAllStarts
in class CodeEditorFindAndReplaceTarget
public void replaceAllEnds()
FindAndReplaceTarget
replaceAllEnds
in interface FindAndReplaceTarget
replaceAllEnds
in class CodeEditorFindAndReplaceTarget
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |