Class AbstractJFlexCTokenMaker.CStyleInsertBreakAction
java.lang.Object
javax.swing.AbstractAction
javax.swing.text.TextAction
org.fife.ui.rtextarea.RecordableTextAction
org.fife.ui.rtextarea.RTextAreaEditorKit.InsertBreakAction
org.fife.ui.rsyntaxtextarea.RSyntaxTextAreaEditorKit.InsertBreakAction
org.fife.ui.rsyntaxtextarea.AbstractJFlexCTokenMaker.CStyleInsertBreakAction
- All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
- Enclosing class:
AbstractJFlexCTokenMaker
protected class AbstractJFlexCTokenMaker.CStyleInsertBreakAction
extends RSyntaxTextAreaEditorKit.InsertBreakAction
Action that knows how to special-case inserting a newline in a
multi-line comment for languages like C and Java.
- Version:
- 1.0
- 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 TypeMethodDescriptionvoidactionPerformedImpl(ActionEvent e, RTextArea textArea) The actual meat of the action.private booleanappearsNested(RSyntaxTextArea textArea, int line, int offs) Returns whether the MLC token containingoffsappears to have a "nested" comment (i.e., contains "/*" somewhere inside it).private voidinsertBreakInMLC(ActionEvent e, RSyntaxTextArea textArea, int line) Methods inherited from class RSyntaxTextAreaEditorKit.InsertBreakAction
handleInsertBreakMethods inherited from class RTextAreaEditorKit.InsertBreakAction
getMacroID, isEnabledMethods 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, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
CStyleInsertBreakAction
protected CStyleInsertBreakAction()
-
-
Method Details
-
actionPerformedImpl
Description copied from class:RecordableTextActionThe actual meat of the action. If you wish to subclass this action and modify its behavior, this is the method to override.- Overrides:
actionPerformedImplin classRSyntaxTextAreaEditorKit.InsertBreakAction- Parameters:
e- The action being performed.textArea- The text area "receiving" the action.- See Also:
-
appearsNested
Returns whether the MLC token containingoffsappears to have a "nested" comment (i.e., contains "/*" somewhere inside it). This implies that it is likely a "new" MLC and needs to be closed. While not foolproof, this is usually good enough of a sign.- Parameters:
textArea- The text area being examined.line- The line being examined.offs- The offset being examined.- Returns:
- Whether a comment appears to be nested inside this one.
-
insertBreakInMLC
-