Class TemplateAction

All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action, SyntaxAction

public class TemplateAction extends DefaultSyntaxAction
This action replaces the selection with the configured template in the config ACTION-NAME.Template There are two kinds of templates:
  • Simple Templates are replaced as is
  • Whole Line Templates will ensure a whole line is selected. Each line in the selection will be prefixed, and postfixed with whatever appears on the line in the template
  • See Also:
    • Constructor Details

      • TemplateAction

        public TemplateAction()
    • Method Details

      • actionPerformed

        public void actionPerformed(JTextComponent target, SyntaxDocument sdoc, int dot, ActionEvent e)
        Description copied from class: DefaultSyntaxAction
        Convenience method that will be called if the Action is performed on a JTextComponent. SyntaxActions should generally override this method.
        Overrides:
        actionPerformed in class DefaultSyntaxAction
        Parameters:
        target - (non-null JTextComponent from Action.getSource
        sdoc - (SyntaxDOcument of the text component, could be null)
        dot - (position of caret at text document)
        e - actual ActionEvent passed to actionPerformed
      • setWholeLines

        public void setWholeLines(String value)
      • setTemplate

        public void setTemplate(String t)
      • setMustHaveSelection

        public void setMustHaveSelection(String value)