Package org.fife.rsta.ac.html
Class HtmlLanguageSupport
- java.lang.Object
-
- org.fife.rsta.ac.AbstractLanguageSupport
-
- org.fife.rsta.ac.AbstractMarkupLanguageSupport
-
- org.fife.rsta.ac.html.HtmlLanguageSupport
-
- All Implemented Interfaces:
LanguageSupport
public class HtmlLanguageSupport extends AbstractMarkupLanguageSupport
Language support for HTML. This currently provides the following:- Code completion for HTML5 tags and attributes.
- Automatic creation of closing tags for non-self-closing tags.
- Version:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private HtmlCompletionProviderproviderThe completion provider.private static java.util.Set<java.lang.String>tagsToCloseA cached set of tags that require closing tags.-
Fields inherited from class org.fife.rsta.ac.AbstractMarkupLanguageSupport
INSERT_CLOSING_TAG_ACTION
-
Fields inherited from interface org.fife.rsta.ac.LanguageSupport
PROPERTY_LANGUAGE_PARSER
-
-
Constructor Summary
Constructors Constructor Description HtmlLanguageSupport()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.swing.ListCellRenderer<java.lang.Object>createDefaultCompletionCellRenderer()Creates the default cell renderer to use when none is specified.private HtmlCompletionProvidergetProvider()static java.util.Set<java.lang.String>getTagsToClose()Dirty hack to share this with others, such as PHP and JSP supports.private static java.util.Set<java.lang.String>getTagsToClose(java.lang.String res)Returns a set of tags that require a closing tag, based on a resource in this class's package.voidinstall(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)Installs this support.protected booleanshouldAutoCloseTag(java.lang.String tag)Subclasses should override this method to return whether a specified tag should have its closing tag auto-inserted.voiduninstall(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)Uninstalls this support.-
Methods inherited from class org.fife.rsta.ac.AbstractMarkupLanguageSupport
getAutoAddClosingTags, installKeyboardShortcuts, setAutoAddClosingTags, uninstallKeyboardShortcuts
-
Methods inherited from class org.fife.rsta.ac.AbstractLanguageSupport
createAutoCompletion, getAutoActivationDelay, getAutoCompletionFor, getDefaultCompletionCellRenderer, getShowDescWindow, getTextAreas, installImpl, isAutoActivationEnabled, isAutoCompleteEnabled, isParameterAssistanceEnabled, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setDefaultCompletionCellRenderer, setParameterAssistanceEnabled, setShowDescWindow, uninstallImpl
-
-
-
-
Field Detail
-
provider
private HtmlCompletionProvider provider
The completion provider. This is shared amongst all HTML text areas.
-
tagsToClose
private static java.util.Set<java.lang.String> tagsToClose
A cached set of tags that require closing tags.
-
-
Method Detail
-
createDefaultCompletionCellRenderer
protected javax.swing.ListCellRenderer<java.lang.Object> createDefaultCompletionCellRenderer()
Creates the default cell renderer to use when none is specified. Subclasses can override this method if there is a "better" default renderer for a specific language.- Overrides:
createDefaultCompletionCellRendererin classAbstractLanguageSupport- Returns:
- The default renderer for the completion list.
-
getProvider
private HtmlCompletionProvider getProvider()
-
getTagsToClose
public static java.util.Set<java.lang.String> getTagsToClose()
Dirty hack to share this with others, such as PHP and JSP supports. Note that we should be passing doctype information here.- Returns:
- The set of tags to close.
-
getTagsToClose
private static java.util.Set<java.lang.String> getTagsToClose(java.lang.String res)
Returns a set of tags that require a closing tag, based on a resource in this class's package.- Parameters:
res- The resource.- Returns:
- The set of tags that require closing.
-
install
public void install(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
Installs this support.- Parameters:
textArea- The text area to install onto.- See Also:
LanguageSupport.uninstall(RSyntaxTextArea)
-
shouldAutoCloseTag
protected boolean shouldAutoCloseTag(java.lang.String tag)
Subclasses should override this method to return whether a specified tag should have its closing tag auto-inserted.- Specified by:
shouldAutoCloseTagin classAbstractMarkupLanguageSupport- Parameters:
tag- The name of the tag to check.- Returns:
- Whether the tag should have its closing tag auto-inserted.
-
uninstall
public void uninstall(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea)
Uninstalls this support.- Parameters:
textArea- The text area to uninstall from.- See Also:
LanguageSupport.install(RSyntaxTextArea)
-
-