|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction javax.swing.text.TextAction oracle.javatools.editor.BasicAction oracle.javatools.editor.EmacsAction
The EmacsAction
is an abstract class that all Emacs
actions should extend from. This provides utility routines for
supporting a kill-ring and for setting a mark in the editor.
Nested Class Summary | |
protected static class |
EmacsAction.Tracker
Protected class for tracking an editor and offset to determine whether to merge possibly consecutive kill actions, or for determining whether previous action was a yank or yank pop. |
Field Summary |
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
EmacsAction(java.lang.String actionName)
Constructs this object with the appropriate action name. |
Method Summary | |
abstract void |
actionPerformed(java.awt.event.ActionEvent event,
BasicEditorPane editor,
BasicDocument document)
The operation to perform when this action is triggered in a BasicEditorPane . |
protected static void |
addKillRing(java.lang.String text)
Utility routine to add the given text as the last (top-most) entry in the kill ring. |
protected static void |
appendKillRing(java.lang.String text)
Utility routine to append the given text to the last (top-most) entry in the kill ring. |
protected static java.lang.String |
getClipboardText()
Utility routine to fetch the contents of the system clipboard as a String. |
protected static int |
getMark(BasicEditorPane editor)
Utility routine to fetch the Emacs mark set for the given editor. |
protected static java.awt.datatransfer.Clipboard |
getSystemClipboard()
Utility routine to fetch the system clipboard. |
protected static java.lang.String |
popKillRing()
Utility routine to "pop" the last yank text from the kill ring, and retrieve the text before it from the kill ring. |
protected static void |
prependKillRing(java.lang.String text)
Utility routine to prepend the given text to the last (top-most) entry in the kill ring. |
protected static void |
removeMark(BasicEditorPane editor)
Utility routine to remove the Emacs mark from a given editor (i.e., when it is being closed. |
protected static void |
setClipboardText(java.lang.String text)
Utility routine to set the contents of the system clipboard to the given String text. |
protected static void |
setMark(BasicEditorPane editor,
int offset)
Utility routine to set the Emacs mark for the given editor to the specified offset. |
protected static void |
showEndBufferMessage(BasicEditorPane editor)
Utility routine to show the message that we are at the end of the buffer |
protected static void |
showMarkNotSetMessage(BasicEditorPane editor)
Utility routine to show the message that the mark has not yet been set. |
protected static void |
showMarkSetMessage(BasicEditorPane editor)
Utility routine to show the message that the mark has been set. |
protected static void |
showNextKillAppendMessage(BasicEditorPane editor)
Utility routine to show the message that if the next command is a kill, it will append |
protected static void |
showPreviousNotYankMessage(BasicEditorPane editor)
Utility routine to show the message that the previous command was not a yank. |
protected static void |
showReadOnlyMessage(BasicEditorPane editor)
Utility routine to show the message that the buffer is read-only. |
protected static java.lang.String |
yankKillRing()
Utility routine to yank text from the last yank index of the kill ring, or from the clipboard if the text in the clipboard doesn't match the kill ring (which is generally the case if the user did a cut/copy elsewhere.) |
Methods inherited from class oracle.javatools.editor.BasicAction |
actionPerformed, beep, buildIndent, getFontHeight, getLastAction, getMagicCaretPosition, getName, getSmartIndentProvider, getSpaces, getTab, getTabs, getTabSizeProperty, getUseAutoIndentProperty, getUseTabsProperty, getVisibleRect, isEditable, setMagicCaretPosition, showMessage, skipLeadingIndent |
Methods inherited from class javax.swing.text.TextAction |
augmentList, getFocusedComponent, getTextComponent |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EmacsAction(java.lang.String actionName)
Method Detail |
public abstract void actionPerformed(java.awt.event.ActionEvent event, BasicEditorPane editor, BasicDocument document)
BasicEditorPane
. Implementations should override
this method. Implementations are guaranteed that the document
read lock is held for the duration of this call.
actionPerformed
in class BasicAction
event
- the action eventeditor
- the editor this action was invoked indocument
- the document associated with the editorprotected static void addKillRing(java.lang.String text)
text
- the text to add to the kill ringprotected static void appendKillRing(java.lang.String text)
text
- the text to append to the top-most entry of the clipboardprotected static void prependKillRing(java.lang.String text)
text
- the text to prepend to the top-most entry of the clipboardprotected static java.lang.String yankKillRing()
protected static java.lang.String popKillRing()
protected static java.lang.String getClipboardText()
protected static void setClipboardText(java.lang.String text)
text
- the STring text to put into the system clipboardprotected static java.awt.datatransfer.Clipboard getSystemClipboard()
protected static int getMark(BasicEditorPane editor)
editor
- the editor to retrieve the mark for
protected static void setMark(BasicEditorPane editor, int offset)
editor
- the editor to set the mark foroffset
- the offset to set the mark toprotected static void removeMark(BasicEditorPane editor)
editor
- the editor to remove the mark for.protected static void showMarkSetMessage(BasicEditorPane editor)
editor
- the editor to show the message forprotected static void showMarkNotSetMessage(BasicEditorPane editor)
editor
- the editor to show the message forprotected static void showEndBufferMessage(BasicEditorPane editor)
editor
- the editor to show the message forprotected static void showReadOnlyMessage(BasicEditorPane editor)
editor
- the editor to show the message forprotected static void showNextKillAppendMessage(BasicEditorPane editor)
editor
- the editor to show the message forprotected static void showPreviousNotYankMessage(BasicEditorPane editor)
editor
- the editor to show the message for
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.