All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.awt.text.BasicTextEditController

java.lang.Object
   |
   +----jp.kyasu.awt.text.TextController
           |
           +----jp.kyasu.awt.text.BasicTextEditController

public class BasicTextEditController
extends TextController
implements ActionListener
The BasicTextEditController 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 implements basic operations for the text editing. The TextEditController class (a subclass of this class) implements full operations for the text editing.

The principal editing operations on a BasicTextEditController are the replaceRange (replaceSelection), setRangeTextStyle (setSelectionTextStyle), modifyRangeTextStyle (modifySelectionTextStyle), setRangeParagraphStyle (setSelectionParagraphStyle) and modifyRangeParagraphStyle (modifySelectionParagraphStyle) methods:

Version:
18 Dec 1998
Author:
Kazuki YASUMATSU
See Also:
TextEditModel, TextEditView, TextEditController

Constructor Index

 o BasicTextEditController(TextEditView)
Constructs a text edit controller with the specified text edit view.

Method Index

 o actionPerformed(ActionEvent)
Invoked when an action occurs.
 o addKeyAction(KeyAction)
Adds the key action to the key binding of this controller.
 o append(String)
Appends the given string to the current text.
 o append(Text)
Appends the given text to the current text.
 o append(Text, boolean)
Appends the given text to the current text.
 o clearUndo()
Clears the undo of the last change.
 o copy_clipboard()
Copies the current selection to the clipboard.
 o cut_clipboard()
Cuts the current selection to the clipboard.
 o echoCharIsSet()
Indicates whether or not the view of this controller has a character set for echoing.
 o find_word()
Finds the word and move the insertion cursor to the founded word.
 o find_word(String)
Finds the word and move the insertion cursor to the founded word.
 o find_word(String, String)
Finds the word and move the insertion cursor to the founded word.
 o find_word(String, String, int)
Finds the word and move the insertion cursor to the founded word.
 o focusGained(FocusEvent)
Invoked when a component gains the keyboard focus.
 o focusLost(FocusEvent)
Invoked when a component loses the keyboard focus.
 o getCaretPosition()
Returns the position of the text insertion caret.
 o getClipboardText()
Returns the text in the clipboard.
 o getColumns()
Returns the number of columns in the view of this controller.
 o getCurrentTextStyle()
Returns the current text style of this controller.
 o getEchoChar()
Returns the character that is to be used for echoing.
 o getEditMenu()
Returns the edit menu of this controller.
 o getKeyAction(String)
Returns the key action object associated with the specified name.
 o getKeyBinding()
Returns the key binding of this controller.
 o getKeymap()
Returns the keymap of this controller.
 o getModel()
Returns the model of this controller.
 o getParagraphStyleAt(int)
Returns the paragraph style at the specified index in the view of this controller.
 o getParagraphStyleCount()
Returns the number of the paragraph styles in the text of the view of this controller.
 o getParagraphStyles()
Returns all paragraph styles in the text of the view of this controller.
 o getParagraphStyles(int, int)
Returns the paragraph styles in the text of the view of this controller.
 o getPopupMenu()
Returns the popup menu of this controller.
 o getRichText()
Returns the rich text of the view of this controller.
 o getRows()
Returns the number of rows in the view of this controller.
 o getSelectedString()
Returns the selected string from the view of this controller.
 o getSelectedText()
Returns the selected text from the view of this controller.
 o getSelectionEnd()
Returns the end position of the selected text.
 o getSelectionStart()
Returns the start position of the selected text.
 o getString()
Returns the string of the view of this controller.
 o getString(String)
Returns the string of the view of this controller.
 o getText()
Returns the text of the view of this controller.
 o getTextStyleAt(int)
Returns the text style at the specified index in the view of this controller.
 o getTextStyleCount()
Returns the number of the text styles in the text of the view of this controller.
 o getTextStyles()
Returns all text styles in the text of the view of this controller.
 o getTextStyles(int, int)
Returns the text styles in the text of the view of this controller.
 o getView()
Returns the view of this controller.
 o insert(String, int)
Inserts the specified string at the specified position in the view of this controller.
 o insert(Text, int)
Inserts the specified text at the specified position in the view of this controller.
 o insert(Text, int, boolean)
Inserts the specified text at the specified position in the view of this controller.
 o insert_character(char)
If the cursor is inside the selection, deletes the entire selection.
 o isClickable()
Tests if this controller handles ClickableTextAction.
 o isEditable()
Indicates whether or not the view of this controller is editable.
 o isSelectionVisibleAtFocus()
Tests if the selection becomes visible when the view is focused.
 o keyPressed(KeyEvent)
Invoked when a key has been pressed.
 o keyTyped(KeyEvent)
Invoked when a key has been typed.
 o modifyRangeParagraphStyle(ParagraphStyleModifier, int, int)
Modifies the paragraph style between the indicated start and end positions by the specified paragraph style modifier.
 o modifyRangeParagraphStyle(ParagraphStyleModifier, int, int, boolean)
Modifies the paragraph style between the indicated start and end positions by the specified paragraph style modifier.
 o modifyRangeTextStyle(TextStyleModifier, int, int)
Modifies the text style between the indicated start and end positions by the specified text style modifier.
 o modifyRangeTextStyle(TextStyleModifier, int, int, boolean)
Modifies the text style between the indicated start and end positions by the specified text style modifier.
 o modifySelectionParagraphStyle(ParagraphStyleModifier)
Modifies the paragraph style in the range of the current selection by the specified paragraph style modifier.
 o modifySelectionParagraphStyle(ParagraphStyleModifier, boolean)
Modifies the paragraph style in the range of the current selection by the specified paragraph style modifier.
 o modifySelectionTextStyle(TextStyleModifier)
Modifies the text style in the range of the current selection by the specified text style modifier.
 o modifySelectionTextStyle(TextStyleModifier, boolean)
Modifies the text style in the range of the current selection by the specified text style modifier.
 o mouseClicked(MouseEvent)
Invoked when the mouse has been clicked on a component.
 o mouseDragged(MouseEvent)
Invoked when the mouse button is pressed on a component and then dragged.
 o mouseEntered(MouseEvent)
Invoked when the mouse enters a component.
 o mousePressed(MouseEvent)
Invoked when the mouse has been pressed on a component.
 o mouseReleased(MouseEvent)
Invoked when the mouse has been released on a component.
 o paragraphStyles()
Returns an enumeration of the paragraph styles of the text of the view of this controller.
 o paragraphStyles(int, int)
Returns an enumeration of the paragraph styles of the text of the view of this controller.
 o paste_clipboard()
Pastes the the clipboard before the insertion cursor.
 o paste_cutbuffer()
Pastes the the cut buffer before the insertion cursor.
 o performKeyAction(String)
Performs the key action named the specified name.
 o performKeyAction(String, char)
Performs the key action named the specified name.
 o print(boolean)
Prints the text in the view of this controller with the specified flag determining to print a page number in footer.
 o print(Insets, String, boolean)
Prints the text in the view of this controller with the specified insets, header string, and flag determining to print a page number in footer.
 o print(PrintJob, Insets, String, boolean)
Prints the text in the view of this controller to a print device provided from the specified print job, with the specified insets, header string, and flag determining to print a page number in footer.
 o print(PrintJob, String, boolean)
Prints the text in the view of this controller to a print device provided from the specified print job, with the specified header string and flag determining to print a page number in footer.
 o print(String, boolean)
Prints the text in the view of this controller with the specified header string and flag determining to print a page number in footer.
 o removeKeyAction(KeyAction)
Removes the key action from the key binding of this controller.
 o removeKeyActionNamed(String)
Removes the key action named the specified name from the key binding of this controller.
 o replaceRange(String, int, int)
Replaces string between the indicated start and end positions with the specified replacement string.
 o replaceRange(Text, int, int)
Replaces text between the indicated start and end positions with the specified replacement text.
 o replaceRange(Text, int, int, boolean)
Replaces text between the indicated start and end positions with the specified replacement text.
 o replaceSelection(String)
Replaces string in the range of the current selection with the specified replacement string.
 o replaceSelection(Text)
Replaces text in the range of the current selection with the specified replacement text.
 o replaceSelection(Text, boolean)
Replaces text in the range of the current selection with the specified replacement text.
 o select(int, int)
Selects the text between the specified start and end positions.
 o select(int, int, boolean)
Selects the text between the specified start and end positions.
 o select(int, int, boolean, boolean)
Selects the text between the specified start and end positions.
 o select_all()
Select all text.
 o select_braces()
Select braces at the selection start position.
 o select_braces(TextPositionInfo)
Select braces at the specified text position.
 o select_line()
Select a line at the selection start position.
 o select_line(TextPositionInfo)
Select a line at the specified text position.
 o select_word()
Select a word at the selection start position.
 o select_word(TextPositionInfo)
Select a word at the specified text position.
 o selectAll()
Selects all the text.
 o selectionIsCaret()
Tests if the selection is caret, i.e., null selection.
 o setCaretPosition(int)
Sets the position of the text insertion caret.
 o setCaretPosition(int, boolean)
Sets the position of the text insertion caret.
 o setClickable(boolean)
Makes this controller handle ClickableTextAction.
 o setEchoChar(char)
Sets the echo character for the view of this controller.
 o setEditable(boolean)
Sets the flag that determines whether or not the view this controller is editable.
 o setKeymap(Keymap)
Sets the keymap of this controller.
 o setPopupMenu(PopupMenu)
Sets the popup menu of this controller.
 o setRangeParagraphStyle(ParagraphStyle, int, int)
Sets the paragraph style between the indicated start and end positions to the specified paragraph style.
 o setRangeParagraphStyle(ParagraphStyle, int, int, boolean)
Sets the paragraph style between the indicated start and end positions to the specified paragraph style.
 o setRangeTextStyle(TextStyle, int, int)
Sets the text style between the indicated start and end positions to the specified text style.
 o setRangeTextStyle(TextStyle, int, int, boolean)
Sets the text style between the indicated start and end positions to the specified text style.
 o setRichText(RichText)
Sets the rich text of the view of this controller.
 o setSelectionEnd(int)
Sets the selection end for the view of this controller to the specified position.
 o setSelectionParagraphStyle(ParagraphStyle)
Sets the paragraph style in the range of the current selection to the specified paragraph style.
 o setSelectionParagraphStyle(ParagraphStyle, boolean)
Sets the paragraph style in the range of the current selection to the specified paragraph style.
 o setSelectionStart(int)
Sets the selection start for the view of this controller to the specified position.
 o setSelectionTextStyle(TextStyle)
Sets the text style in the range of the current selection to the specified text style.
 o setSelectionTextStyle(TextStyle, boolean)
Sets the text style in the range of the current selection to the specified text style.
 o setString(String)
Sets the string of the view of this controller.
 o setText(Text)
Sets the text of the view of this controller.
 o setUndo(Undo)
Sets the undo.
 o textStyles()
Returns an enumeration of the text styles of text of the view of this controller.
 o textStyles(int, int)
Returns an enumeration of the text styles of text of the view of this controller.
 o undo()
Undo the last change.

Constructors

 o BasicTextEditController
 public BasicTextEditController(TextEditView view)
Constructs a text edit controller with the specified text edit view.

Parameters:
view - the text edit view.

Methods

 o getModel
 public TextEditModel getModel()
Returns the model of this controller.

 o getView
 public TextView getView()
Returns the view of this controller.

Overrides:
getView in class TextController
 o isSelectionVisibleAtFocus
 public boolean isSelectionVisibleAtFocus()
Tests if the selection becomes visible when the view is focused.

Overrides:
isSelectionVisibleAtFocus in class TextController
 o getClipboardText
 public Text getClipboardText()
Returns the text in the clipboard.

Overrides:
getClipboardText in class TextController
 o getKeymap
 public Keymap getKeymap()
Returns the keymap of this controller.

See Also:
setKeymap
 o setKeymap
 public synchronized void setKeymap(Keymap keymap)
Sets the keymap of this controller.

See Also:
getKeymap
 o getKeyBinding
 public KeyBinding getKeyBinding()
Returns the key binding of this controller.

See Also:
getKeyAction, addKeyAction, removeKeyAction, removeKeyActionNamed
 o getKeyAction
 public KeyAction getKeyAction(String actionName)
Returns the key action object associated with the specified name.

Parameters:
actionName - the name of the key action.
Returns:
the key action object, or null if no associated action exists.
See Also:
addKeyAction, removeKeyAction, removeKeyActionNamed
 o addKeyAction
 public synchronized void addKeyAction(KeyAction keyAction)
Adds the key action to the key binding of this controller.

Parameters:
keyAction - the key action object.
See Also:
getKeyAction, removeKeyAction, removeKeyActionNamed
 o removeKeyAction
 public synchronized void removeKeyAction(KeyAction keyAction)
Removes the key action from the key binding of this controller.

Parameters:
keyAction - the key action object.
See Also:
addKeyAction, getKeyAction, removeKeyActionNamed
 o removeKeyActionNamed
 public synchronized void removeKeyActionNamed(String actionName)
Removes the key action named the specified name from the key binding of this controller.

Parameters:
actionName - the name of the key action.
See Also:
addKeyAction, getKeyAction, removeKeyAction
 o performKeyAction
 public void performKeyAction(String actionName)
Performs the key action named the specified name.

Parameters:
actionName - the name of the key action.
See Also:
performKeyAction
 o performKeyAction
 public synchronized void performKeyAction(String actionName,
                                           char keyChar)
Performs the key action named the specified name.

Parameters:
actionName - the name of the key action.
keyChar - the key character for the key action.
See Also:
performKeyAction
 o isClickable
 public boolean isClickable()
Tests if this controller handles ClickableTextAction.

See Also:
setClickable, ClickableTextAction
 o setClickable
 public void setClickable(boolean b)
Makes this controller handle ClickableTextAction.

See Also:
isClickable, ClickableTextAction
 o getEditMenu
 public Menu getEditMenu()
Returns the edit menu of this controller.

 o getPopupMenu
 public synchronized PopupMenu getPopupMenu()
Returns the popup menu of this controller.

See Also:
setPopupMenu
 o setPopupMenu
 public void setPopupMenu(PopupMenu menu)
Sets the popup menu of this controller.

See Also:
getPopupMenu
 o getString
 public String getString()
Returns the string of the view of this controller.

See Also:
getString, setString
 o getString
 public String getString(String separator)
Returns the string of the view of this controller.

Parameters:
separator - the separator string.
See Also:
getString, setString, getSystemString
 o setString
 public synchronized void setString(String str)
Sets the string of the view of this controller.

See Also:
getString
 o getSelectedString
 public String getSelectedString()
Returns the selected string from the view of this controller.

 o isEditable
 public boolean isEditable()
Indicates whether or not the view of this controller is editable.

See Also:
setEditable
 o setEditable
 public synchronized void setEditable(boolean b)
Sets the flag that determines whether or not the view this controller is editable.

See Also:
isEditable
 o getSelectionStart
 public int getSelectionStart()
Returns the start position of the selected text.

See Also:
setSelectionStart, getSelectionEnd
 o setSelectionStart
 public void setSelectionStart(int selectionStart)
Sets the selection start for the view of this controller to the specified position.

See Also:
getSelectionStart, setSelectionEnd
 o getSelectionEnd
 public int getSelectionEnd()
Returns the end position of the selected text.

See Also:
setSelectionEnd, getSelectionStart
 o setSelectionEnd
 public void setSelectionEnd(int selectionEnd)
Sets the selection end for the view of this controller to the specified position.

See Also:
getSelectionEnd, setSelectionStart
 o select
 public void select(int selectionStart,
                    int selectionEnd)
Selects the text between the specified start and end positions.

Parameters:
selectionStart - the start position of the text to select.
selectionEnd - the end position of the text to select.
See Also:
setSelectionStart, setSelectionEnd, select, selectAll
 o selectAll
 public void selectAll()
Selects all the text.

See Also:
select
 o getCaretPosition
 public int getCaretPosition()
Returns the position of the text insertion caret.

See Also:
setCaretPosition
 o setCaretPosition
 public void setCaretPosition(int position)
Sets the position of the text insertion caret.

See Also:
getCaretPosition, setCaretPosition
 o selectionIsCaret
 public boolean selectionIsCaret()
Tests if the selection is caret, i.e., null selection.

 o insert
 public void insert(String str,
                    int pos)
Inserts the specified string at the specified position in the view of this controller.

Parameters:
str - the string to insert.
pos - the position at which to insert.
See Also:
replaceRange
 o append
 public void append(String str)
Appends the given string to the current text.

Parameters:
str - the string to append.
See Also:
insert
 o replaceRange
 public void replaceRange(String str,
                          int start,
                          int end)
Replaces string between the indicated start and end positions with the specified replacement string.

Parameters:
str - the string to use as the replacement.
start - the start position, inclusive.
end - the end position, exclusive.
See Also:
replaceRange
 o getRows
 public int getRows()
Returns the number of rows in the view of this controller.

See Also:
getColumns
 o getColumns
 public int getColumns()
Returns the number of columns in the view of this controller.

See Also:
getRows
 o getEchoChar
 public char getEchoChar()
Returns the character that is to be used for echoing.

See Also:
setEchoChar, echoCharIsSet
 o setEchoChar
 public synchronized void setEchoChar(char c)
Sets the echo character for the view of this controller.

See Also:
getEchoChar, echoCharIsSet
 o echoCharIsSet
 public boolean echoCharIsSet()
Indicates whether or not the view of this controller has a character set for echoing.

See Also:
getEchoChar, setEchoChar
 o getCurrentTextStyle
 public TextStyle getCurrentTextStyle()
Returns the current text style of this controller.

 o getTextStyleAt
 public TextStyle getTextStyleAt(int index)
Returns the text style at the specified index in the view of this controller.

Returns:
the text style at the specified index, or null if the index is out of range.
 o getTextStyleCount
 public int getTextStyleCount()
Returns the number of the text styles in the text of the view of this controller.

 o getTextStyles
 public TextStyle[] getTextStyles()
Returns all text styles in the text of the view of this controller.

 o getTextStyles
 public TextStyle[] getTextStyles(int begin,
                                  int end)
Returns the text styles in the text of the view of this controller.

Parameters:
begin - the beginning index to get text styles, inclusive.
end - the ending index to get text styles, exclusive.
 o textStyles
 public Enumeration textStyles()
Returns an enumeration of the text styles of text of the view of this controller.

 o textStyles
 public Enumeration textStyles(int begin,
                               int end)
Returns an enumeration of the text styles of text of the view of this controller.

Parameters:
begin - the beginning index to get styles, inclusive.
end - the ending index to get styles, exclusive.
 o getParagraphStyleAt
 public ParagraphStyle getParagraphStyleAt(int index)
Returns the paragraph style at the specified index in the view of this controller.

Returns:
the paragraph style at the specified index, or null if the index is out of range.
 o getParagraphStyleCount
 public int getParagraphStyleCount()
Returns the number of the paragraph styles in the text of the view of this controller.

 o getParagraphStyles
 public ParagraphStyle[] getParagraphStyles()
Returns all paragraph styles in the text of the view of this controller.

 o getParagraphStyles
 public ParagraphStyle[] getParagraphStyles(int begin,
                                            int end)
Returns the paragraph styles in the text of the view of this controller.

Parameters:
begin - the beginning index of the text to get paragraph styles, inclusive.
end - the ending index of the text to get paragraph styles, exclusive.
 o paragraphStyles
 public Enumeration paragraphStyles()
Returns an enumeration of the paragraph styles of the text of the view of this controller.

 o paragraphStyles
 public Enumeration paragraphStyles(int begin,
                                    int end)
Returns an enumeration of the paragraph styles of the text of the view of this controller.

Parameters:
begin - the beginning index to get styles, inclusive.
end - the ending index to get styles, exclusive.
 o getText
 public Text getText()
Returns the text of the view of this controller.

See Also:
setText
 o setText
 public synchronized void setText(Text text)
Sets the text of the view of this controller.

See Also:
getText
 o getRichText
 public RichText getRichText()
Returns the rich text of the view of this controller.

See Also:
setRichText
 o setRichText
 public synchronized void setRichText(RichText richText)
Sets the rich text of the view of this controller.

See Also:
getRichText
 o getSelectedText
 public Text getSelectedText()
Returns the selected text from the view of this controller.

 o select
 public void select(int selectionStart,
                    int selectionEnd,
                    boolean scroll)
Selects the text between the specified start and end positions.

Parameters:
selectionStart - the start position of the text to select.
selectionEnd - the end position of the text to select.
scroll - if true, scrolls the view after selection done.
See Also:
select
 o select
 public void select(int selectionStart,
                    int selectionEnd,
                    boolean scroll,
                    boolean top)
Selects the text between the specified start and end positions.

Parameters:
selectionStart - the start position of the text to select.
selectionEnd - the end position of the text to select.
scroll - if true, scrolls the view after selection done.
top - if true, scrolls to the top of the view.
See Also:
select, select
 o setCaretPosition
 public void setCaretPosition(int position,
                              boolean top)
Sets the position of the text insertion caret.

Parameters:
position - the position of the caret.
top - if true, scrolls to the top of the view.
See Also:
setCaretPosition
 o insert
 public void insert(Text text,
                    int pos)
Inserts the specified text at the specified position in the view of this controller.

Parameters:
text - the text to insert.
pos - the position at which to insert.
See Also:
insert
 o insert
 public void insert(Text text,
                    int pos,
                    boolean scroll)
Inserts the specified text at the specified position in the view of this controller.

Parameters:
text - the text to insert.
pos - the position at which to insert.
scroll - if true, scrolls the view after the insertion.
See Also:
insert, replaceRange
 o append
 public void append(Text text)
Appends the given text to the current text.

Parameters:
text - the text to append.
See Also:
append
 o append
 public void append(Text text,
                    boolean scroll)
Appends the given text to the current text.

Parameters:
text - the text to append.
scroll - if true, scrolls the view after the appending.
See Also:
insert
 o replaceRange
 public void replaceRange(Text text,
                          int start,
                          int end)
Replaces text between the indicated start and end positions with the specified replacement text.

Parameters:
text - the text to use as the replacement.
start - the start position, inclusive.
end - the end position, exclusive.
See Also:
replaceRange
 o replaceRange
 public void replaceRange(Text text,
                          int start,
                          int end,
                          boolean scroll)
Replaces text between the indicated start and end positions with the specified replacement text.

Parameters:
text - the text to use as the replacement.
start - the start position, inclusive.
end - the end position, exclusive.
scroll - if true, scrolls the view after replace done.
See Also:
replaceRange, replaceRange, replaceSelection
 o replaceSelection
 public void replaceSelection(String str)
Replaces string in the range of the current selection with the specified replacement string.

Parameters:
str - the string to use as the replacement.
See Also:
replaceSelection
 o replaceSelection
 public void replaceSelection(Text text)
Replaces text in the range of the current selection with the specified replacement text.

Parameters:
text - the text to use as the replacement.
See Also:
replaceSelection
 o replaceSelection
 public void replaceSelection(Text text,
                              boolean scroll)
Replaces text in the range of the current selection with the specified replacement text.

Parameters:
text - the text to use as the replacement.
scroll - if true, scrolls the view after replace done.
See Also:
replaceSelection, replaceSelection, replaceRange
 o setRangeTextStyle
 public void setRangeTextStyle(TextStyle style,
                               int start,
                               int end)
Sets the text style between the indicated start and end positions to the specified text style.

Parameters:
style - the text style to be set.
start - the start position, inclusive.
end - the end position, exclusive.
See Also:
setRangeTextStyle
 o setRangeTextStyle
 public void setRangeTextStyle(TextStyle style,
                               int start,
                               int end,
                               boolean scroll)
Sets the text style between the indicated start and end positions to the specified text style.

Parameters:
style - the text style to be set.
start - the start position, inclusive.
end - the end position, exclusive.
scroll - if true, scrolls the view after set done.
See Also:
setRangeTextStyle, setSelectionTextStyle
 o setSelectionTextStyle
 public void setSelectionTextStyle(TextStyle style)
Sets the text style in the range of the current selection to the specified text style.

Parameters:
style - the text style to be set.
See Also:
setSelectionTextStyle
 o setSelectionTextStyle
 public void setSelectionTextStyle(TextStyle style,
                                   boolean scroll)
Sets the text style in the range of the current selection to the specified text style.

Parameters:
style - the text style to be set.
scroll - if true, scrolls the view after set done.
See Also:
setSelectionTextStyle, setRangeTextStyle
 o modifyRangeTextStyle
 public void modifyRangeTextStyle(TextStyleModifier modifier,
                                  int start,
                                  int end)
Modifies the text style between the indicated start and end positions by the specified text style modifier.

Parameters:
modifier - the text style modifier.
start - the start position, inclusive.
end - the end position, exclusive.
See Also:
modifyRangeTextStyle
 o modifyRangeTextStyle
 public void modifyRangeTextStyle(TextStyleModifier modifier,
                                  int start,
                                  int end,
                                  boolean scroll)
Modifies the text style between the indicated start and end positions by the specified text style modifier.

Parameters:
modifier - the text style modifier.
start - the start position, inclusive.
end - the end position, exclusive.
scroll - if true, scrolls the view after set done.
See Also:
modifyRangeTextStyle, modifySelectionTextStyle
 o modifySelectionTextStyle
 public void modifySelectionTextStyle(TextStyleModifier modifier)
Modifies the text style in the range of the current selection by the specified text style modifier.

Parameters:
modifier - the text style modifier.
See Also:
modifySelectionTextStyle
 o modifySelectionTextStyle
 public void modifySelectionTextStyle(TextStyleModifier modifier,
                                      boolean scroll)
Modifies the text style in the range of the current selection by the specified text style modifier.

Parameters:
modifier - the text style modifier.
scroll - if true, scrolls the view after set done.
See Also:
modifySelectionTextStyle, modifyRangeTextStyle
 o setRangeParagraphStyle
 public void setRangeParagraphStyle(ParagraphStyle style,
                                    int start,
                                    int end)
Sets the paragraph style between the indicated start and end positions to the specified paragraph style.

Parameters:
style - the paragraph style to be set.
start - the start position, inclusive.
end - the end position, exclusive.
See Also:
setRangeParagraphStyle
 o setRangeParagraphStyle
 public void setRangeParagraphStyle(ParagraphStyle style,
                                    int start,
                                    int end,
                                    boolean scroll)
Sets the paragraph style between the indicated start and end positions to the specified paragraph style.

Parameters:
style - the paragraph style to be set.
start - the start position, inclusive.
end - the end position, exclusive.
scroll - if true, scrolls the view after set done.
See Also:
setRangeParagraphStyle, setSelectionParagraphStyle
 o setSelectionParagraphStyle
 public void setSelectionParagraphStyle(ParagraphStyle style)
Sets the paragraph style in the range of the current selection to the specified paragraph style.

Parameters:
style - the paragraph style to be set.
See Also:
setSelectionParagraphStyle
 o setSelectionParagraphStyle
 public void setSelectionParagraphStyle(ParagraphStyle style,
                                        boolean scroll)
Sets the paragraph style in the range of the current selection to the specified paragraph style.

Parameters:
style - the paragraph style to be set.
scroll - if true, scrolls the view after set done.
See Also:
setSelectionParagraphStyle, setRangeParagraphStyle
 o modifyRangeParagraphStyle
 public void modifyRangeParagraphStyle(ParagraphStyleModifier modifier,
                                       int start,
                                       int end)
Modifies the paragraph style between the indicated start and end positions by the specified paragraph style modifier.

Parameters:
modifier - the paragraph style modifier.
start - the start position, inclusive.
end - the end position, exclusive.
See Also:
modifyRangeParagraphStyle
 o modifyRangeParagraphStyle
 public void modifyRangeParagraphStyle(ParagraphStyleModifier modifier,
                                       int start,
                                       int end,
                                       boolean scroll)
Modifies the paragraph style between the indicated start and end positions by the specified paragraph style modifier.

Parameters:
modifier - the paragraph style modifier.
start - the start position, inclusive.
end - the end position, exclusive.
scroll - if true, scrolls the view after set done.
See Also:
modifyRangeParagraphStyle, modifySelectionParagraphStyle
 o modifySelectionParagraphStyle
 public void modifySelectionParagraphStyle(ParagraphStyleModifier modifier)
Modifies the paragraph style in the range of the current selection by the specified paragraph style modifier.

Parameters:
modifier - the paragraph style modifier.
See Also:
modifySelectionParagraphStyle
 o modifySelectionParagraphStyle
 public void modifySelectionParagraphStyle(ParagraphStyleModifier modifier,
                                           boolean scroll)
Modifies the paragraph style in the range of the current selection by the specified paragraph style modifier.

Parameters:
modifier - the paragraph style modifier.
scroll - if true, scrolls the view after set done.
See Also:
modifySelectionParagraphStyle, modifyRangeParagraphStyle
 o print
 public void print(boolean printPageNum)
Prints the text in the view of this controller with the specified flag determining to print a page number in footer.

Parameters:
printPageNum - if true, prints a page number in footer.
 o print
 public void print(String header,
                   boolean printPageNum)
Prints the text in the view of this controller with the specified header string and flag determining to print a page number in footer.

Parameters:
header - the header string.
printPageNum - if true, prints a page number in footer.
 o print
 public void print(Insets insets,
                   String header,
                   boolean printPageNum)
Prints the text in the view of this controller with the specified insets, header string, and flag determining to print a page number in footer.

Parameters:
insets - the insets of a printing medium (paper).
header - the header string.
printPageNum - if true, prints a page number in footer.
 o print
 public void print(PrintJob job,
                   String header,
                   boolean printPageNum)
Prints the text in the view of this controller to a print device provided from the specified print job, with the specified header string and flag determining to print a page number in footer.

Parameters:
job - the print job.
header - the header string.
printPageNum - if true, prints a page number in footer.
 o print
 public synchronized void print(PrintJob job,
                                Insets insets,
                                String header,
                                boolean printPageNum)
Prints the text in the view of this controller to a print device provided from the specified print job, with the specified insets, header string, and flag determining to print a page number in footer.

Parameters:
job - the print job.
insets - the insets of a printing medium (paper).
header - the header string.
printPageNum - if true, prints a page number in footer.
 o mouseClicked
 public void mouseClicked(MouseEvent e)
Invoked when the mouse has been clicked on a component.

Overrides:
mouseClicked in class TextController
See Also:
MouseListener
 o mousePressed
 public void mousePressed(MouseEvent e)
Invoked when the mouse has been pressed on a component.

Overrides:
mousePressed in class TextController
See Also:
MouseListener
 o mouseReleased
 public void mouseReleased(MouseEvent e)
Invoked when the mouse has been released on a component.

Overrides:
mouseReleased in class TextController
See Also:
MouseListener
 o mouseEntered
 public void mouseEntered(MouseEvent e)
Invoked when the mouse enters a component.

Overrides:
mouseEntered in class TextController
See Also:
MouseListener
 o mouseDragged
 public void mouseDragged(MouseEvent e)
Invoked when the mouse button is pressed on a component and then dragged.

Overrides:
mouseDragged in class TextController
See Also:
MouseMotionListener
 o keyTyped
 public void keyTyped(KeyEvent e)
Invoked when a key has been typed.

Overrides:
keyTyped in class TextController
See Also:
KeyListener
 o keyPressed
 public void keyPressed(KeyEvent e)
Invoked when a key has been pressed.

Overrides:
keyPressed in class TextController
See Also:
KeyListener
 o focusGained
 public void focusGained(FocusEvent e)
Invoked when a component gains the keyboard focus.

Overrides:
focusGained in class TextController
See Also:
FocusListener
 o focusLost
 public void focusLost(FocusEvent e)
Invoked when a component loses the keyboard focus.

Overrides:
focusLost in class TextController
See Also:
FocusListener
 o actionPerformed
 public void actionPerformed(ActionEvent e)
Invoked when an action occurs.

See Also:
ActionListener
 o insert_character
 public void insert_character(char c)
If the cursor is inside the selection, deletes the entire selection. Inserts character at the insertion cursor.

 o undo
 public void undo()
Undo the last change.

 o clearUndo
 public void clearUndo()
Clears the undo of the last change.

 o setUndo
 public void setUndo(Undo undo)
Sets the undo.

 o copy_clipboard
 public void copy_clipboard()
Copies the current selection to the clipboard.

 o cut_clipboard
 public void cut_clipboard()
Cuts the current selection to the clipboard.

 o paste_cutbuffer
 public void paste_cutbuffer()
Pastes the the cut buffer before the insertion cursor.

 o paste_clipboard
 public void paste_clipboard()
Pastes the the clipboard before the insertion cursor.

 o select_all
 public void select_all()
Select all text.

 o select_braces
 public boolean select_braces()
Select braces at the selection start position.

See Also:
select_braces
 o select_braces
 public boolean select_braces(TextPositionInfo posInfo)
Select braces at the specified text position.

See Also:
select_braces
 o select_line
 public void select_line()
Select a line at the selection start position.

See Also:
select_line
 o select_line
 public void select_line(TextPositionInfo posInfo)
Select a line at the specified text position.

See Also:
select_line
 o select_word
 public void select_word()
Select a word at the selection start position.

See Also:
select_word
 o select_word
 public void select_word(TextPositionInfo posInfo)
Select a word at the specified text position.

See Also:
select_word
 o find_word
 public void find_word()
Finds the word and move the insertion cursor to the founded word.

See Also:
find_word, find_word, find_word
 o find_word
 public boolean find_word(String find)
Finds the word and move the insertion cursor to the founded word.

Parameters:
find - the word to be found.
Returns:
true if the word has been found, false otherwise.
See Also:
find_word, find_word, find_word
 o find_word
 public boolean find_word(String find,
                          String rep)
Finds the word and move the insertion cursor to the founded word.

Parameters:
find - the word to be found.
rep - the replacement string.
Returns:
true if the word has been found, false otherwise.
See Also:
find_word, find_word, find_word
 o find_word
 public boolean find_word(String find,
                          String rep,
                          int startIndex)
Finds the word and move the insertion cursor to the founded word.

Parameters:
find - the word to be found.
rep - the replacement string.
startIndex - the starting index to find.
Returns:
true if the word has been found, false otherwise.
See Also:
find_word, find_word, find_word

All Packages  Class Hierarchy  This Package  Previous  Next  Index