Class RSyntaxTextAreaEditorKit.DumbCompleteWordAction
java.lang.Object
javax.swing.AbstractAction
javax.swing.text.TextAction
org.fife.ui.rtextarea.RecordableTextAction
org.fife.ui.rtextarea.RTextAreaEditorKit.DumbCompleteWordAction
org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaEditorKit.DumbCompleteWordAction
- All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
- Enclosing class:
RSyntaxTextAreaEditorKit
public static class RSyntaxTextAreaEditorKit.DumbCompleteWordAction
extends RTextAreaEditorKit.DumbCompleteWordAction
Overridden to use the programming language RSTA is displaying when
computing words to complete.
- Version:
- 0.5
- Author:
- Robert Futrell
- See Also:
-
Field Summary
Fields inherited from class AbstractAction
changeSupport, enabledFields inherited from interface Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intgetPreviousWord(RTextArea textArea, int offs) protected intgetWordEnd(RTextArea textArea, int offs) protected intgetWordStart(RTextArea textArea, int offs) protected booleanisAcceptablePrefix(String prefix) Overridden to not suggest word completions if the text right before the caret contains non-word characters, such as '/' or '%'.Methods inherited from class RTextAreaEditorKit.DumbCompleteWordAction
actionPerformedImpl, getMacroIDMethods inherited from class RecordableTextAction
actionPerformed, getAccelerator, getDescription, getIcon, getMnemonic, getName, getShortDescription, isRecordable, setAccelerator, setMnemonic, setMnemonic, setName, setProperties, setRecordable, setShortDescriptionMethods inherited from class TextAction
augmentList, getFocusedComponent, getTextComponentMethods inherited from class AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
DumbCompleteWordAction
public DumbCompleteWordAction()
-
-
Method Details
-
getPreviousWord
- Overrides:
getPreviousWordin classRTextAreaEditorKit.DumbCompleteWordAction- Throws:
BadLocationException
-
getWordEnd
- Overrides:
getWordEndin classRTextAreaEditorKit.DumbCompleteWordAction- Throws:
BadLocationException
-
getWordStart
- Overrides:
getWordStartin classRTextAreaEditorKit.DumbCompleteWordAction- Throws:
BadLocationException
-
isAcceptablePrefix
Overridden to not suggest word completions if the text right before the caret contains non-word characters, such as '/' or '%'.- Overrides:
isAcceptablePrefixin classRTextAreaEditorKit.DumbCompleteWordAction- Parameters:
prefix- The prefix characters before the caret.- Returns:
- Whether the prefix could be part of a "word" in the context of the text area's current content.
-