Package org.fife.ui.autocomplete
Class MarkupTagCompletion
- java.lang.Object
-
- org.fife.ui.autocomplete.AbstractCompletion
-
- org.fife.ui.autocomplete.MarkupTagCompletion
-
- All Implemented Interfaces:
java.lang.Comparable<Completion>
,Completion
public class MarkupTagCompletion extends AbstractCompletion
A completion representing a tag in markup, such as HTML or XML.- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ParameterizedCompletion.Parameter>
attrs
Attributes of the tag.private java.lang.String
definedIn
private java.lang.String
desc
private java.lang.String
name
-
Constructor Summary
Constructors Constructor Description MarkupTagCompletion(CompletionProvider provider, java.lang.String name)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addAttributes(java.lang.StringBuilder sb)
Adds HTML describing the attributes of this tag to a buffer.protected void
addDefinitionString(java.lang.StringBuilder sb)
ParameterizedCompletion.Parameter
getAttribute(int index)
Returns the specifiedParameterizedCompletion.Parameter
.int
getAttributeCount()
Returns the number of attributes of this tag.java.util.List<ParameterizedCompletion.Parameter>
getAttributes()
Returns all attributes of this tag.java.lang.String
getDefinedIn()
Returns where this variable is defined.java.lang.String
getDescription()
Returns a short description of this variable.java.lang.String
getName()
Returns the name of this tag.java.lang.String
getReplacementText()
Returns the text to insert as the result of this auto-completion.java.lang.String
getSummary()
Returns the description of this auto-complete choice.protected void
possiblyAddDefinedIn(java.lang.StringBuilder sb)
Adds some HTML describing where this variable is defined, if this information is known.protected void
possiblyAddDescription(java.lang.StringBuilder sb)
Adds the description text as HTML to a buffer, if a description is defined.void
setAttributes(java.util.List<? extends ParameterizedCompletion.Parameter> attrs)
Sets the attributes of this tag.void
setDefinedIn(java.lang.String definedIn)
Sets where this variable is defined.void
setDescription(java.lang.String desc)
Sets the short description of this tag.-
Methods inherited from class org.fife.ui.autocomplete.AbstractCompletion
compareTo, getAlreadyEntered, getIcon, getInputText, getProvider, getRelevance, getToolTipText, setIcon, setRelevance, toString
-
-
-
-
Field Detail
-
name
private java.lang.String name
-
desc
private java.lang.String desc
-
definedIn
private java.lang.String definedIn
-
attrs
private java.util.List<ParameterizedCompletion.Parameter> attrs
Attributes of the tag.
-
-
Constructor Detail
-
MarkupTagCompletion
public MarkupTagCompletion(CompletionProvider provider, java.lang.String name)
Constructor.- Parameters:
provider
- The parent provider instance.name
- The name of the tag.
-
-
Method Detail
-
addAttributes
protected void addAttributes(java.lang.StringBuilder sb)
Adds HTML describing the attributes of this tag to a buffer.- Parameters:
sb
- The buffer to append to.
-
addDefinitionString
protected void addDefinitionString(java.lang.StringBuilder sb)
-
getAttributes
public java.util.List<ParameterizedCompletion.Parameter> getAttributes()
Returns all attributes of this tag.- Returns:
- A list of
ParameterizedCompletion.Parameter
s. - See Also:
getAttribute(int)
,getAttributeCount()
-
getAttribute
public ParameterizedCompletion.Parameter getAttribute(int index)
Returns the specifiedParameterizedCompletion.Parameter
.- Parameters:
index
- The index of the attribute to retrieve.- Returns:
- The attribute.
- See Also:
getAttributeCount()
-
getAttributeCount
public int getAttributeCount()
Returns the number of attributes of this tag.- Returns:
- The number of attributes of this tag.
- See Also:
getAttribute(int)
-
getDefinedIn
public java.lang.String getDefinedIn()
Returns where this variable is defined.- Returns:
- Where this variable is defined.
- See Also:
setDefinedIn(String)
-
getDescription
public java.lang.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:
setDescription(String)
-
getName
public java.lang.String getName()
Returns the name of this tag.- Returns:
- The name of this tag.
-
getReplacementText
public java.lang.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:
Completion.getInputText()
-
getSummary
public java.lang.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(java.lang.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(java.lang.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(java.lang.String definedIn)
Sets where this variable is defined.- Parameters:
definedIn
- Where this variable is defined.- See Also:
getDefinedIn()
-
setDescription
public void setDescription(java.lang.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 benull
.- See Also:
getDescription()
-
setAttributes
public void setAttributes(java.util.List<? extends ParameterizedCompletion.Parameter> attrs)
Sets the attributes of this tag.- Parameters:
attrs
- The attributes.- See Also:
getAttribute(int)
,getAttributeCount()
-
-