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