Module platform

Class MarkupTagCompletion

java.lang.Object
de.grogra.pf.ui.autocomplete.impl.AbstractCompletion
de.grogra.pf.ui.autocomplete.impl.MarkupTagCompletion
All Implemented Interfaces:
Completion, Comparable<Completion>

public class MarkupTagCompletion extends AbstractCompletion
A completion representing a tag in markup, such as HTML or XML.
Version:
1.0
Author:
Robert Futrell
  • Constructor Details

    • MarkupTagCompletion

      public MarkupTagCompletion(CompletionProvider provider, String name)
      Constructor.
      Parameters:
      provider - The parent provider instance.
      name - The name of the tag.
  • Method Details

    • addAttributes

      protected void addAttributes(StringBuilder sb)
      Adds HTML describing the attributes of this tag to a buffer.
      Parameters:
      sb - The buffer to append to.
    • addDefinitionString

      protected void addDefinitionString(StringBuilder sb)
    • getAttributes

      public List<ParameterizedCompletion.Parameter> getAttributes()
      Returns all attributes of this tag.
      Returns:
      A list of ParameterizedCompletion.Parameters.
      See Also:
    • getAttribute

      public ParameterizedCompletion.Parameter getAttribute(int index)
      Returns the specified ParameterizedCompletion.Parameter.
      Parameters:
      index - The index of the attribute to retrieve.
      Returns:
      The attribute.
      See Also:
    • getAttributeCount

      public int getAttributeCount()
      Returns the number of attributes of this tag.
      Returns:
      The number of attributes of this tag.
      See Also:
    • getDefinedIn

      public String getDefinedIn()
      Returns where this variable is defined.
      Returns:
      Where this variable is defined.
      See Also:
    • getDescription

      public String getDescription()
      Returns a short description of this variable. This should be an HTML snippet.
      Returns:
      A short description of this variable. This may be null.
      See Also:
    • getName

      public String getName()
      Returns the name of this tag.
      Returns:
      The name of this tag.
    • getReplacementText

      public String getReplacementText()
      Description copied from interface: Completion
      Returns the text to insert as the result of this auto-completion. This is the "complete" text, including any text that replaces what the user has already typed.
      Returns:
      The replacement text.
      See Also:
    • getSummary

      public String getSummary()
      Description copied from interface: Completion
      Returns the description of this auto-complete choice. This can be used in a popup "description window."
      Returns:
      This item's description. This should be HTML. It may be null if there is no description for this completion.
    • possiblyAddDefinedIn

      protected void possiblyAddDefinedIn(StringBuilder sb)
      Adds some HTML describing where this variable is defined, if this information is known.
      Parameters:
      sb - The buffer to append to.
    • possiblyAddDescription

      protected void possiblyAddDescription(StringBuilder sb)
      Adds the description text as HTML to a buffer, if a description is defined.
      Parameters:
      sb - The buffer to append to.
    • setDefinedIn

      public void setDefinedIn(String definedIn)
      Sets where this variable is defined.
      Parameters:
      definedIn - Where this variable is defined.
      See Also:
    • setDescription

      public void setDescription(String desc)
      Sets the short description of this tag. This should be an HTML snippet.
      Parameters:
      desc - A short description of this tag. This may be null.
      See Also:
    • setAttributes

      public void setAttributes(List<? extends ParameterizedCompletion.Parameter> attrs)
      Sets the attributes of this tag.
      Parameters:
      attrs - The attributes.
      See Also: