Package jsyntaxpane.actions
Class DefaultSyntaxAction
java.lang.Object
javax.swing.AbstractAction
javax.swing.text.TextAction
jsyntaxpane.actions.DefaultSyntaxAction
- All Implemented Interfaces:
ActionListener,Serializable,Cloneable,EventListener,Action,SyntaxAction
- Direct Known Subclasses:
ComboCompletionAction,CompleteWordAction,DeleteLinesAction,DuplicateLinesAction,FindNextAction,FindReplaceAction,GotoLineAction,HTMLPreviewAction,IndentAction,JIndentAction,JumpToPairAction,JUnindentAction,MapCompletionAction,PairAction,PythonIndentAction,QuickFindAction,RedoAction,ReflectCompletionAction,ScriptAction,ScriptRunnerAction,ShowAbbsAction,SmartHomeAction,SmartHomeSelectAction,TemplateAction,ToggleCommentsAction,ToggleComponentAction,UndoAction,UnindentAction,XmlPrettifyAction,XmlTagCompleteAction
The DefaultSyntaxAction. You can extend this class or implement the interface
SyntaxAction to create your own actions.
- See Also:
-
Field Summary
FieldsFields inherited from class javax.swing.AbstractAction
changeSupport, enabledFields inherited from interface javax.swing.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 TypeMethodDescriptionvoidvoidactionPerformed(JTextComponent target, SyntaxDocument sDoc, int dot, ActionEvent e) Convenience method that will be called if the Action is performed on a JTextComponent.voidconfig(Configuration config, String name) Configure the actions in this classfinal voidsetLargeIcon(String url) Sets the Large Icon for this action from given urlfinal voidsetMenuText(String text) Configure the MenuText for the Actionfinal voidsetSmallIcon(String url) Configure the SmallIcon for the Actionfinal voidsetToolTip(String text) Configure the ToolTip for the ActiontoString()Methods inherited from class javax.swing.text.TextAction
augmentList, getFocusedComponent, getTextComponentMethods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabledMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface javax.swing.Action
accept, addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Field Details
-
ACTION_PREFIX
- See Also:
-
SMALL_ICONS_LOC_PREFIX
- See Also:
-
LARGE_ICONS_LOC_PREFIX
- See Also:
-
-
Constructor Details
-
DefaultSyntaxAction
-
-
Method Details
-
config
Description copied from interface:SyntaxActionConfigure the actions in this class- Specified by:
configin interfaceSyntaxActionname- Name of the action, (prefixed by Action.) will be obtained from the property Key as the text following the Action.
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
actionPerformed
Convenience method that will be called if the Action is performed on a JTextComponent. SyntaxActions should generally override this method.- Parameters:
target- (non-null JTextComponent from Action.getSourcesDoc- (SyntaxDOcument of the text component, could be null)dot- (position of caret at text document)e- actual ActionEvent passed to actionPerformed
-
toString
-
setMenuText
Configure the MenuText for the Action- Parameters:
text-
-
setToolTip
Configure the ToolTip for the Action- Parameters:
text-
-
setLargeIcon
Sets the Large Icon for this action from given url- Parameters:
url-
-
setSmallIcon
Configure the SmallIcon for the Action- Parameters:
url-
-