Class GlobalTemplateVariables.Selection

Direct Known Subclasses:
GlobalTemplateVariables.LineSelection, GlobalTemplateVariables.WordSelection
Enclosing class:
GlobalTemplateVariables

public static class GlobalTemplateVariables.Selection extends SimpleTemplateVariableResolver
The selection variable determines templates that work on a selection.
Since:
3.6
  • Constructor Details

    • Selection

      public Selection(String name, String description)
      Creates a word selection variable.
      Parameters:
      name - the name of the variable
      description - the description of the variable
  • Method Details

    • resolve

      protected String resolve(TemplateContext context)
      Description copied from class: TemplateVariableResolver
      Returns an instance of the type resolved by the receiver available in context. To resolve means to provide a binding to a concrete text object (a String) in the given context.

      The default implementation looks up the type in the context.

      Overrides:
      resolve in class SimpleTemplateVariableResolver
      Parameters:
      context - the context in which to resolve the type
      Returns:
      the name of the text object of this type, or null if it cannot be determined
    • resolve

      public void resolve(TemplateVariable variable, TemplateContext context)
      Description copied from class: TemplateVariableResolver
      Resolves variable in context. To resolve means to find a valid binding of the receiver's type in the given TemplateContext. If the variable can be successfully resolved, its value is set using TemplateVariable.setValues(String[]).
      Overrides:
      resolve in class TemplateVariableResolver
      Parameters:
      variable - the variable to resolve
      context - the context in which variable is resolved