Important: The information in this document is obsolete and should not be used for new development.
Package | com.apple.cocoa.application |
Companion guide |
This interface is implemented by objects in the responder chain that manipulate selections and edit text.
cancelOperation
capitalizeWord
centerSelectionInVisibleArea
changeCaseOfLetter
complete
deleteBackward
deleteBackwardByDecomposingPreviousCharacter
deleteForward
deleteToBeginningOfLine
deleteToBeginningOfParagraph
deleteToEndOfLine
deleteToEndOfParagraph
deleteToMark
deleteWordBackward
deleteWordForward
indent
insertBacktab
insertNewline
insertNewlineIgnoringFieldEditor
insertParagraphSeparator
insertTab
insertTabIgnoringFieldEditor
insertText
lowercaseWord
moveBackward
moveBackwardAndModifySelection
moveDown
moveDownAndModifySelection
moveForward
moveForwardAndModifySelection
moveLeft
moveLeftAndModifySelection
moveRight
moveRightAndModifySelection
moveToBeginningOfDocument
moveToBeginningOfLine
moveToBeginningOfParagraph
moveToEndOfDocument
moveToEndOfLine
moveToEndOfParagraph
moveUp
moveUpAndModifySelection
moveWordBackward
moveWordBackwardAndModifySelection
moveWordForward
moveWordForwardAndModifySelection
moveWordLeft
moveWordLeftAndModifySelection
moveWordRight
moveWordRightAndModifySelection
pageDown
pageUp
scrollLineDown
scrollLineUp
scrollPageDown
scrollPageUp
selectAll
selectLine
selectParagraph
selectToMark
selectWord
setMark
swapWithMark
transpose
transposeWords
uppercaseWord
yank
Implemented by subclasses to cancel the current operation.
public abstract void cancelOperation
(Object sender)
This method is bound to the Escape and Command-. (period) keys. The key window first propagates the key equivalent down its view hierarchy. If none of these views handles the key equivalent, the window sends a default action message of cancel
to the first responder and from there the message travels up the responder chain. The sender argument is typically the object that invoked this method.
This action method capitalizes the word or words surrounding the insertion point or selection, expanding the selection if necessary.
public abstract void capitalizeWord
(Object sender)
If either end of the selection partially covers a word, that entire word is made lowercase.
This action method scrolls the selection, whatever it is, inside its visible area.
public abstract void centerSelectionInVisibleArea
(Object sender)
This action method changes the case of a letter or letters in the selection, perhaps by opening a panel with capitalization options or by cycling through possible case combinations.
public abstract void changeCaseOfLetter
(Object sender)
This action method completes an operation in progress or a partially constructed element.
public abstract void complete
(Object sender)
This method can be interpreted, for example, as a request to attempt expansion of a partial word, such as for expanding a glossary shortcut, or to close a graphics item being drawn.
This action method deletes the selection, if there is one, or a single element backward from the insertion point (a letter or character in text, for example).
public abstract void deleteBackward
(Object sender)
public abstract void deleteBackwardByDecomposingPreviousCharacter
(Object sender)
Implemented by subclasses to delete the selection, if there is one, or a single character backward from the insertion point. If the previous character is canonically decomposable, this method should try to delete only the last character in the grapheme cluster (for example, deleting “a”+ “´” results in “a”). The sender argument is typically the object that invoked this method.
This action method deletes the selection, if there is one, or a single element forward from the insertion point (a letter or character in text, for example).
public abstract void deleteForward
(Object sender)
This action method deletes the selection, if there is one, or all text from the insertion point to the beginning of a line (typically of text).
public abstract void deleteToBeginningOfLine
(Object sender)
Also places the deleted text into the kill buffer.
This action method deletes the selection, if there is one, or all text from the insertion point to the beginning of a paragraph of text.
public abstract void deleteToBeginningOfParagraph
(Object sender)
Also places the deleted text into the kill buffer.
This action method deletes the selection, if there is one, or all text from the insertion point to the end of a line (typically of text).
public abstract void deleteToEndOfLine
(Object sender)
Also places the deleted text into the kill buffer.
This action method deletes the selection, if there is one, or all text from the insertion point to the end of a paragraph of text.
public abstract void deleteToEndOfParagraph
(Object sender)
Also places the deleted text into the kill buffer.
This action method deletes the selection, if there is one, or all items from the insertion point to a previously placed mark, including the selection itself if not empty.
public abstract void deleteToMark
(Object sender)
Also places the deleted text into the kill buffer.
This action method deletes the selection, if there is one, or a single word backward from the insertion point.
public abstract void deleteWordBackward
(Object sender)
This action method deletes the selection, if there is one, or a single word forward from the insertion point.
public abstract void deleteWordForward
(Object sender)
Attempts to perform the method indicated by aSelector.
public abstract void doCommandBySelector
(NSSelector aSelector)
The method should take a single argument of type Object and return void. If the receiver responds to aSelector, it invokes the method with null
as the argument. If the receiver doesn’t respond, it sends this message to its next responder with the same selector. NSWindow and NSApplication also send the message to their delegates. If the receiver has no next responder or delegate, it beeps.
tryToPerform
sendActionToTargetFromSender
(NSApplication)This action method indents the selection or the insertion point if there is no selection.
public abstract void indent
(Object sender)
This action method handles a “backward tab.”
public abstract void insertBacktab
(Object sender)
A field editor might respond to this method by selecting the field before it, while a regular text object either doesn’t respond to or ignores such a message.
This action method inserts a line-break character at the insertion point or selection, deleting the selection if there is one, or to end editing if the receiver is a text field or other field editor.
public abstract void insertNewline
(Object sender)
This action method inserts a line-break character at the insertion point or selection, deleting the selection if there is one.
public abstract void insertNewlineIgnoringFieldEditor
(Object sender)
Unlike insertNewline
, this method always inserts a line-break character and doesn’t cause the receiver to end editing.
This action method inserts a paragraph separator at the insertion point or selection, deleting the selection if there is one.
public abstract void insertParagraphSeparator
(Object sender)
This action method inserts a tab character at the insertion point or selection, deleting the selection if there is one, or to end editing if the receiver is a text field or other field editor.
public abstract void insertTab
(Object sender)
This action method inserts a tab character at the insertion point or selection, deleting the selection if there is one.
public abstract void insertTabIgnoringFieldEditor
(Object sender)
Unlike insertTab
, this method always inserts a tab character and doesn’t cause the receiver to end editing.
Inserts anObject at the insertion point or selection, deleting the selection if there is one.
public abstract void insertText
(Object anObject)
This action method lowercases every letter in the word or words surrounding the insertion point or selection, expanding the selection if necessary.
public abstract void lowercaseWord
(Object sender)
If either end of the selection partially covers a word, that entire word is made lowercase.
This action method moves the selection or insertion point one element or character backward.
public abstract void moveBackward
(Object sender)
In text, if there is a selection it should be deselected, and the insertion point should be placed at the beginning of the former selection.
This action method expands or reduce either end of the selection backward by one element or character.
public abstract void moveBackwardAndModifySelection
(Object sender)
If the end being modified is the backward end, this method expands the selection; if the end being modified is the forward end, it reduces the selection. The first moveBackwardAndModifySelection
or moveForwardAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the backward end becoming the mobile one if invoked first.
This action method moves the selection or insertion point one element or character down.
public abstract void moveDown
(Object sender)
In text, if there is a selection it should be deselected, and the insertion point should be placed below the beginning of the former selection.
This action method expands or reduces the top or bottom end of the selection downward by one element, character, or line (whichever is appropriate for text direction).
public abstract void moveDownAndModifySelection
(Object sender)
If the end being modified is the bottom, this method expands the selection; if the end being modified is the top, it reduces the selection. The first moveDownAndModifySelection
or moveUpAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the bottom end becoming the mobile one if invoked first.
This action method moves the selection or insertion point one element or character forward.
public abstract void moveForward
(Object sender)
In text, if there is a selection it should be deselected, and the insertion point should be placed at the end of the former selection.
This action method expands or reduces either end of the selection forward by one element or character.
public abstract void moveForwardAndModifySelection
(Object sender)
If the end being modified is the backward end, this method reduces the selection; if the end being modified is the forward end, it expands the selection. The first moveBackwardAndModifySelection
or moveForwardAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the forward end becoming the mobile one if invoked first.
This action method moves the selection or insertion point one element or character to the left.
public abstract void moveLeft
(Object sender)
In text, if there is a selection it should be deselected, and the insertion point should be placed at the left end of the former selection.
Implemented by subclasses to expand or reduce either end of the selection to the left (display order) by one element or character.
public abstract void moveLeftAndModifySelection
(Object sender)
If the end being modified is the left end, this method expands the selection; if the end being modified is the right end, it reduces the selection. The first moveLeftAndModifySelection
or moveRightAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the left end becoming the mobile one if invoked first.
The sender argument is typically the object that invoked this method.
The essential difference between this method and the corresponding moveBackwardAndModifySelection
is that the latter method moves in logical order, which can differ in bidirectional text, whereas this method moves in display order.
This action method moves the selection or insertion point one element or character to the right.
public abstract void moveRight
(Object sender)
In text, if there is a selection it should be deselected, and the insertion point should be placed at the right end of the former selection.
Implemented by subclasses to expand or reduce either end of the selection to the right (display order) by one element or character.
public abstract void moveRightAndModifySelection
(Object sender)
If the end being modified is the left end, this method reduces the selection; if the end being modified is the right end, it expands the selection. The first moveLeftAndModifySelection
or moveRightAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the right end becoming the mobile one if invoked first.
The sender argument is typically the object that invoked this method.
The essential difference between this method and the corresponding moveForwardAndModifySelection
is that the latter method moves in logical order, which can differ in bidirectional text, whereas this method moves in display order.
This action method moves the selection to the first element of the document, or the insertion point to the beginning.
public abstract void moveToBeginningOfDocument
(Object sender)
This action method moves the selection to the first element of the selected line, or the insertion point to the beginning of the line.
public abstract void moveToBeginningOfLine
(Object sender)
This action method moves the insertion point to the beginning of the selected paragraph.
public abstract void moveToBeginningOfParagraph
(Object sender)
This action method moves the selection to the last element of the document, or the insertion point to the end.
public abstract void moveToEndOfDocument
(Object sender)
This action method moves the selection to the last element of the selected line, or the insertion point to the end of the line.
public abstract void moveToEndOfLine
(Object sender)
This action method moves the insertion point to the end of the selected paragraph.
public abstract void moveToEndOfParagraph
(Object sender)
This action method moves the selection or insertion point one element or character up.
public abstract void moveUp
(Object sender)
In text, if there is a selection it should be deselected, and the insertion point should be placed above the beginning of the former selection.
This action method expands or reduces the top or bottom end of the selection upward by one element, character, or line (whichever is appropriate for text direction).
public abstract void moveUpAndModifySelection
(Object sender)
If the end being modified is the bottom, this method reduces the selection; if the end being modified is the top, it expands the selection. The first moveDownAndModifySelection
or moveUpAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the top end becoming the mobile one if invoked first.
This action method moves the selection or insertion point one word backward.
public abstract void moveWordBackward
(Object sender)
If there is a selection it should be deselected, and the insertion point should be placed at the end of the first word preceding the former selection.
This action method expands or reduces either end of the selection backward by one whole word.
public abstract void moveWordBackwardAndModifySelection
(Object sender)
If the end being modified is the backward end, this method expands the selection; if the end being modified is the forward end, it reduces the selection. The first moveWordBackwardAndModifySelection
or moveWordForwardAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the backward end becoming the mobile one if invoked first.
This action method moves the selection or insertion point one word forward.
public abstract void moveWordForward
(Object sender)
If there is a selection it should be deselected, and the insertion point should be placed at the beginning of the first word following the former selection.
This action method expands or reduces either end of the selection forward by one whole word.
public abstract void moveWordForwardAndModifySelection
(Object sender)
Implemented by subclasses to move the selection or insertion point one word to the left, in display order.
If the end being modified is the backward end, this method reduces the selection; if the end being modified is the forward end, it expands the selection. The first moveWordBackwardAndModifySelection
or moveWordForwardAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the forward end becoming the mobile one if invoked first.
Implemented by subclasses to expand or reduce either end of the selection left by one whole word in display order.
public abstract void moveWordLeft
(Object sender)
If there is a selection it should be deselected, and the insertion point should be placed at the end of the first word to the left of the former selection. The sender argument is typically the object that invoked this method.
The main difference between this method and the corresponding moveWordBackward
method is that the latter moves in logical order, which is important in bidirectional text, whereas this method moves in display order.
Implemented by subclasses to expand or reduce either end of the selection left by one whole word in display order.
public abstract void moveWordLeftAndModifySelection
(Object sender)
If the end being modified is the left end, this method expands the selection; if the end being modified is the right end, it reduces the selection. The first moveWordLeftAndModifySelection
or moveWordRightAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the left end becoming the mobile one if invoked first.
The main difference between this method and the corresponding moveWordBackwardAndModifySelection
method is that the latter moves in logical order, which is important in bidirectional text, whereas this method moves in display order.
The sender argument is typically the object that invoked this method.
Implemented by subclasses to move the selection or insertion point one word right.
public abstract void moveWordRight
(Object sender)
If there is a selection it should be deselected, and the insertion point should be placed at the beginning of the first word to the right of the former selection. The sender argument is typically the object that invoked this method.
The main difference between this method and the corresponding moveWordForward
method is that the latter moves in logical order, which is important in bidirectional text, whereas this method moves in display order.
Implemented by subclasses to expand or reduce either end of the selection to the right by one whole word.
public abstract void moveWordRightAndModifySelection
(Object sender)
If the end being modified is the backward end, this method reduces the selection; if the end being modified is the forward end, it expands the selection. The first moveWordBackwardAndModifySelection
or moveWordForwardAndModifySelection
method in a series determines the end being modified by always expanding. Hence, this method results in the forward end becoming the mobile one if invoked first. The sender argument is typically the object that invoked this method.
The main difference between this method and the corresponding moveWordForwardAndModifySelection
method is that the latter moves in logical order, which is important in bidirectional text, whereas this method moves in display order.
This action method scrolls the receiver down (or back) one page in its scroll view, also moving the insertion point to the top of the newly displayed page.
public abstract void pageDown
(Object sender)
This action method scrolls the receiver up (or forward) one page in its scroll view, also moving the insertion point to the top of the newly-displayed page.
public abstract void pageUp
(Object sender)
This action method scrolls the receiver one line down in its scroll view, without changing the selection.
public abstract void scrollLineDown
(Object sender)
scrollLineUp
lineScroll
(NSScrollView)This action method scrolls the receiver one line up in its scroll view, without changing the selection.
public abstract void scrollLineUp
(Object sender)
scrollLineDown
lineScroll
(NSScrollView)This action method scrolls the receiver one page down in its scroll view, without changing the selection.
public abstract void scrollPageDown
(Object sender)
pageDown
pageUp
pageScroll
(NSScrollView)This action method scrolls the receiver one page up in its scroll view, without changing the selection.
public abstract void scrollPageUp
(Object sender)
pageDown
pageUp
pageScroll
(NSScrollView)This action method selects all selectable elements.
public abstract void selectAll
(Object sender)
This action method selects all elements in the line or lines containing the selection or insertion point.
public abstract void selectLine
(Object sender)
This action method selects all paragraphs containing the selection or insertion point.
public abstract void selectParagraph
(Object sender)
This action method selects all items from the insertion point or selection to a previously placed mark, including the selection itself if not empty.
public abstract void selectToMark
(Object sender)
This action method extends the selection to the nearest word boundaries outside it (up to, but not including, word delimiters).
public abstract void selectWord
(Object sender)
This action method sets a mark at the insertion point or selection, which is used by deleteToMark
and selectToMark
.
public abstract void setMark
(Object sender)
This action method swaps the mark and the selection or insertion point, so that what was marked is now the selection or insertion point, and what was the insertion point or selection is now the mark.
public abstract void swapWithMark
(Object sender)
This action method transposes the characters to either side of the insertion point and advances the insertion point past both of them. Does nothing to a selected range of text.
public abstract void transpose
(Object sender)
This action method transposes the two words prior to the insertion point and advances the insertion point past both of them. Not currently implemented by NSTextView.
public abstract void transposeWords
(Object sender)
This action method makes uppercase every letter in the word or words surrounding the insertion point or selection, expanding the selection if necessary.
public abstract void uppercaseWord
(Object sender)
If either end of the selection partially covers a word, that entire word is made uppercase.
This action method replaces the insertion point or selection with text from the kill buffer.
public abstract void yank
(Object sender)
If invoked sequentially, cycles through the kill buffer in reverse order.
deleteToBeginningOfLine
deleteToEndOfLine
deleteToBeginningOfParagraph
deleteToEndOfParagraph
deleteToMark
© 1997, 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-02-01)