org.fife.ui.autocomplete
Class MarkupTagCompletion

java.lang.Object
  extended by org.fife.ui.autocomplete.AbstractCompletion
      extended by org.fife.ui.autocomplete.MarkupTagCompletion
All Implemented Interfaces:
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 Summary
MarkupTagCompletion(CompletionProvider provider, String name)
          Constructor.
 
Method Summary
protected  void addAttributes(StringBuffer sb)
          Adds HTML describing the attributes of this tag to a buffer.
protected  void addDefinitionString(StringBuffer sb)
           
 ParameterizedCompletion.Parameter getAttribute(int index)
          Returns the specified ParameterizedCompletion.Parameter.
 int getAttributeCount()
          Returns the number of attributes of this tag.
 String getDefinedIn()
          Returns where this variable is defined.
 String getDescription()
          Returns a short description of this variable.
 String getName()
          Returns the name of this tag.
 String getReplacementText()
          Returns the text to insert as the result of this auto-completion.
 String getSummary()
          Returns the description of this auto-complete choice.
protected  void possiblyAddDefinedIn(StringBuffer sb)
          Adds some HTML describing where this variable is defined, if this information is known.
protected  void possiblyAddDescription(StringBuffer sb)
          Adds the description text as HTML to a buffer, if a description is defined.
 void setAttributes(List attrs)
          Sets the attributes of this tag.
 void setDefinedIn(String definedIn)
          Sets where this variable is defined.
 void setDescription(String desc)
          Sets the short description of this tag.
 
Methods inherited from class org.fife.ui.autocomplete.AbstractCompletion
compareTo, getAlreadyEntered, getInputText, getProvider, getRelevance, getToolTipText, setRelevance, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MarkupTagCompletion

public MarkupTagCompletion(CompletionProvider provider,
                           String name)
Constructor.

Parameters:
provider - The parent provider instance.
name - The name of the tag.
Method Detail

addAttributes

protected void addAttributes(StringBuffer sb)
Adds HTML describing the attributes of this tag to a buffer.

Parameters:
sb - The buffer to append to.

addDefinitionString

protected void addDefinitionString(StringBuffer sb)

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()

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 String getDefinedIn()
Returns where this variable is defined.

Returns:
Where this variable is defined.
See Also:
setDefinedIn(String)

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:
setDescription(String)

getName

public String getName()
Returns the name of this tag.

Returns:
The name of this tag.

getReplacementText

public String getReplacementText()
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 String getSummary()
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(StringBuffer 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(StringBuffer 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:
getDefinedIn()

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:
getDescription()

setAttributes

public void setAttributes(List attrs)
Sets the attributes of this tag.

Parameters:
attrs - The attributes.
See Also:
getAttribute(int), getAttributeCount()


Copyright © 2003-2011. All Rights Reserved.