public class TextEditController extends BasicTextEditController
TextEditController class implements a controller
of a MVC model for the text editing. The model of the MVC model is a
TextEditModel object and the view of the MVC model is a
TextEditView object.
The BasicTextEditController class (a superclass of this class)
implements basic operations for the text editing. The
TextEditController class implements full operations for the
text editing.
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected KeyAction[] |
availabelKeyActions |
protected static Keymap |
DEFAULT_KEYMAP
The default key map.
|
protected int |
softTab |
clickable, CLOSE_BRACES, composedTextBegin, composedTextEnd, dragCurrent, dragOrigin, editMenu, keyBinding, lastUndo, model, OPEN_BRACES, popupMenu, savedTypeInStyle, typeInStyle, typeInText, viewA_COPY, A_CUT, A_FIND, A_PASTE, A_PRINT, A_UNDO, CLICK_TO_FOCUS, clickToFocus, L_COPY, L_CUT, L_EDIT, L_FIND, L_PASTE, L_PRINT, L_UNDO, lostClipboardOwnership, selectionVisibleAtFocus| コンストラクタと説明 |
|---|
TextEditController(TextEditView view)
Constructs a text edit controller with the specified text edit view.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
backward_character()
Moves the insertion cursor one character to the left.
|
void |
backward_word()
Moves the insertion cursor to the first non-whitespace character
after the first whitespace character to the left or the beginning of
the line.
|
void |
beep()
Causes the terminal to beep.
|
void |
beginning_of_file()
Moves the insertion cursor to the beginning of the text.
|
void |
beginning_of_line()
Moves the insertion cursor to the beginning of the line.
|
void |
clearSoftTab()
Disables soft tab.
|
void |
delete_next_character()
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the character following the insert cursor.
|
void |
delete_next_character(boolean kill)
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the character following the insert cursor.
|
void |
delete_next_word()
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the characters following the insertion cursor to
the next space, tab or end of line character.
|
void |
delete_next_word(boolean kill)
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the characters following the insertion cursor to
the next space, tab or end of line character.
|
void |
delete_previous_character()
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the character of text immediately preceding the
insertion cursor.
|
void |
delete_previous_character(boolean kill)
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the character of text immediately preceding the
insertion cursor.
|
void |
delete_previous_word()
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the characters preceding the insertion cursor to
the previous space, tab or beginning of line character.
|
void |
delete_previous_word(boolean kill)
If the cursor is inside the selection, deletes the entire selection;
otherwise, deletes the characters preceding the insertion cursor to
the previous space, tab or beginning of line character.
|
void |
delete_selection()
Deletes the current selection.
|
void |
delete_selection(boolean kill)
Deletes the current selection.
|
void |
delete_to_end_of_line()
Deletes the characters following the insertion cursor to the next
end of line character.
|
void |
delete_to_end_of_line(boolean kill)
Deletes the characters following the insertion cursor to the next
end of line character.
|
void |
delete_to_start_of_line()
Deletes the characters preceding the insertion cursor to the previous
beginning of line character.
|
void |
delete_to_start_of_line(boolean kill)
Deletes the characters preceding the insertion cursor to the previous
beginning of line character.
|
void |
deselect_all()
Deselects the current selection.
|
void |
do_nothing()
Do nothing, but KeyEvent is consumed.
|
void |
end_of_file()
Moves the insertion cursor to the end of the text.
|
void |
end_of_line()
Moves the insertion cursor to the end of the line.
|
void |
forward_character()
Moves the insertion cursor one character to the right.
|
void |
forward_word()
Moves the insertion cursor to the first whitespace character or
end of line following the next non-whitespace character.
|
KeyAction[] |
getAvailableKeyActions()
Returns the available key action objects in this controller.
|
static Keymap |
getDefaultKeymap()
Returns the default key map.
|
protected int |
getNextWordIndex(TextPositionInfo posInfo)
Returns the starting index of the next word.
|
protected int |
getPrevWordIndex(TextPositionInfo posInfo)
Returns the starting index of the previous word.
|
int |
getSoftTab()
Returns the length of soft tab.
|
protected int |
getWordBeginIndex(TextPositionInfo posInfo)
Returns the starting index of the current word.
|
protected int |
getWordEndIndex(TextPositionInfo posInfo)
Returns the ending index of the current word.
|
void |
goto_line()
Go to line.
|
void |
goto_line(int lineNo)
Go to the specified number of the line.
|
void |
insert_string(java.lang.String str)
If the cursor is inside the selection, deletes the entire selection.
|
boolean |
isSoftTab()
Checks if this controller allows soft tab.
|
void |
kill_next_character()
If the cursor is inside the selection, deletes the entire selection.
|
void |
kill_next_word()
If the cursor is inside the selection, deletes the entire selection.
|
void |
kill_previous_character()
If the cursor is inside the selection, deletes the entire selection.
|
void |
kill_previous_word()
If the cursor is inside the selection, deletes the entire selection.
|
void |
kill_selection()
Kills the currently selected text and stores the text in the cut buffer.
|
void |
kill_to_end_of_line()
Kills the characters following the insertion cursor to the next end
of line character and stores the characters in the cut buffer.
|
void |
kill_to_start_of_line()
Kills the characters preceding the insertion cursor to the next
beginning of line character and stores the characters in the cut buffer.
|
void |
newbreak()
If the cursor is inside the selection, deletes the entire selection.
|
void |
newline_and_indent()
If the cursor is inside the selection, deletes the entire selection.
|
void |
newline()
If the cursor is inside the selection, deletes the entire selection.
|
void |
next_line()
Moves the insertion cursor to the next line.
|
void |
next_page()
Moves the insertion cursor forward one page.
|
void |
previous_line()
Moves the insertion cursor to the previous line.
|
void |
previous_page()
Moves the insertion cursor back one page.
|
void |
redraw_display()
Redraw the display.
|
void |
setSoftTab(int i)
Sets the length of soft tab.
|
void |
show_match(char keyChar)
Show match.
|
void |
tab()
If the cursor is inside the selection, deletes the entire selection.
|
void |
unkill()
Restores last killed text to the position of the insertion cursor.
|
actionPerformed, addKeyAction, addToView, append, append, append, caretPositionChanged, changeParagraphStyle, changeTextStyle, clearUndo, copy_clipboard, createEditMenu, createFindDialog, createMenuItem, createPopupMenu, cut_clipboard, dragSelectionTo, echoCharIsSet, find_word, find_word, find_word, find_word, focusGained, focusLost, getCaretPosition, getClipboardText, getColumns, getCurrentTextStyle, getEchoChar, getEditMenu, getKeyAction, getKeyBinding, getKeymap, getModel, getParagraphStyleAt, getParagraphStyleCount, getParagraphStyles, getParagraphStyles, getPopupMenu, getRichText, getRows, getSelectedString, getSelectedText, getSelectionEnd, getSelectionStart, getString, getString, getText, getTextStyleAt, getTextStyleCount, getTextStyles, getTextStyles, getView, inputMethodTextChanged, insert_character, insert, insert, insert, isClickable, isEditable, isSelectionVisibleAtFocus, keyPressed, keyTyped, modifyRangeParagraphStyle, modifyRangeParagraphStyle, modifyRangeTextStyle, modifyRangeTextStyle, modifySelectionParagraphStyle, modifySelectionParagraphStyle, modifySelectionTextStyle, modifySelectionTextStyle, mouseClicked, mouseDragged, mouseEntered, mousePressed, mouseReleased, notifyTextPositionListeners, paragraphStyles, paragraphStyles, paste_clipboard, paste_cutbuffer, performKeyAction, performKeyAction, print, print, print, print, print, removeKeyAction, removeKeyActionNamed, replaceInputMethodText, replaceRange, replaceRange, replaceRange, replaceRange, replaceSelection, replaceSelection, replaceSelection, select_all, select_braces, select_braces, select_line, select_line, select_word, select_word, select, select, select, select, selectAll, selectionIsCaret, setCaretPosition, setCaretPosition, setClickable, setCurrentTypeIn, setEchoChar, setEditable, setInputMethodCaretPosition, setKeymap, setMenuEnabled, setPopupMenu, setRangeParagraphStyle, setRangeParagraphStyle, setRangeTextStyle, setRangeTextStyle, setRichText, setSelectionBegin, setSelectionBeginEnd, setSelectionBeginEnd, setSelectionEnd, setSelectionEnd, setSelectionParagraphStyle, setSelectionParagraphStyle, setSelectionStart, setSelectionTextStyle, setSelectionTextStyle, setString, setText, setUndo, textStyles, textStyles, undogetClipboardString, getClipboardText, getCutBufferText, getResourceString, isClickToFocus, isMouseFocus, keyReleased, lostOwnership, mouseExited, mouseMoved, removeFromView, setClickToFocus, setClipboardString, setClipboardText, setCutBuffer, setMouseFocus, setSelectionVisibleAtFocusprotected int softTab
protected KeyAction[] availabelKeyActions
protected static final Keymap DEFAULT_KEYMAP
public TextEditController(TextEditView view)
view - the text edit view.public static Keymap getDefaultKeymap()
public boolean isSoftTab()
public int getSoftTab()
setSoftTab(int),
isSoftTab(),
clearSoftTab()public void setSoftTab(int i)
i - the length of soft tab. if the length is less than 0, disables
soft tab.getSoftTab(),
isSoftTab(),
clearSoftTab()public void clearSoftTab()
isSoftTab(),
getSoftTab(),
setSoftTab(int)public KeyAction[] getAvailableKeyActions()
public void backward_character()
public void backward_word()
public void beep()
public void beginning_of_file()
public void beginning_of_line()
public void delete_next_character()
public void delete_next_character(boolean kill)
kill - if true, copies the deleted characters to the clipboard.delete_next_character(),
kill_next_character()public void delete_next_word()
public void delete_next_word(boolean kill)
kill - if true, copies the deleted characters to the clipboard.delete_next_word(),
kill_next_word()public void delete_previous_character()
public void delete_previous_character(boolean kill)
kill - if true, copies the deleted characters to the clipboard.delete_previous_character(),
kill_previous_character()public void delete_previous_word()
public void delete_previous_word(boolean kill)
kill - if true, copies the deleted characters to the clipboard.delete_previous_word(),
kill_previous_word()public void delete_selection()
public void delete_selection(boolean kill)
kill - if true, copies the deleted characters to the clipboard.delete_selection(),
kill_selection()public void delete_to_end_of_line()
public void delete_to_end_of_line(boolean kill)
kill - if true, copies the deleted characters to the clipboard.delete_to_end_of_line(),
kill_to_end_of_line()public void delete_to_start_of_line()
public void delete_to_start_of_line(boolean kill)
kill - if true, copies the deleted characters to the clipboard.delete_to_start_of_line(),
kill_to_start_of_line()public void deselect_all()
public void do_nothing()
public void end_of_file()
public void end_of_line()
public void forward_character()
public void forward_word()
public void goto_line()
public void goto_line(int lineNo)
public void insert_string(java.lang.String str)
public void kill_next_character()
public void kill_next_word()
public void kill_previous_character()
public void kill_previous_word()
public void kill_selection()
public void kill_to_end_of_line()
public void kill_to_start_of_line()
public void newbreak()
public void newline()
public void newline_and_indent()
public void next_line()
public void next_page()
public void previous_line()
public void previous_page()
public void redraw_display()
public void show_match(char keyChar)
public void tab()
public void unkill()
protected int getNextWordIndex(TextPositionInfo posInfo)
protected int getPrevWordIndex(TextPositionInfo posInfo)
protected int getWordBeginIndex(TextPositionInfo posInfo)
protected int getWordEndIndex(TextPositionInfo posInfo)