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, enabled
Fields 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 TypeMethodDescriptionvoid
void
actionPerformed
(JTextComponent target, SyntaxDocument sDoc, int dot, ActionEvent e) Convenience method that will be called if the Action is performed on a JTextComponent.void
config
(Configuration config, String name) Configure the actions in this classfinal void
setLargeIcon
(String url) Sets the Large Icon for this action from given urlfinal void
setMenuText
(String text) Configure the MenuText for the Actionfinal void
setSmallIcon
(String url) Configure the SmallIcon for the Actionfinal void
setToolTip
(String text) Configure the ToolTip for the ActiontoString()
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, wait, wait, wait
Methods 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:SyntaxAction
Configure the actions in this class- Specified by:
config
in interfaceSyntaxAction
- Parameters:
config
-name
- Name of the action, (prefixed by Action.) will be obtained from the property Key as the text following the Action.
-
actionPerformed
- Specified by:
actionPerformed
in 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
-
-