Class GlobalTemplateVariables.Selection

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

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

    • Selection

      public Selection(String name, String description)
      Creates a word selection variable.
      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.

      resolve in class SimpleTemplateVariableResolver
      context - the context in which to resolve the type
      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[]).
      resolve in class TemplateVariableResolver
      variable - the variable to resolve
      context - the context in which variable is resolved