Class AbstractMarkupLanguageSupport
java.lang.Object
org.fife.rsta.ac.AbstractLanguageSupport
org.fife.rsta.ac.AbstractMarkupLanguageSupport
- All Implemented Interfaces:
LanguageSupport
- Direct Known Subclasses:
HtmlLanguageSupport, JspLanguageSupport, PhpLanguageSupport, XmlLanguageSupport
Base class for language supports for markup languages, such as HTML, PHP,
and JSP. This class facilitates support for automatically adding a closing
tag (e.g. "
</foo>") when the user types an opening tag
(e.g. "<foo attr='val'>").- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classAction that checks whether a closing tag should be auto-inserted into the document. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether closing tags are automatically added when the user types opening tags.protected static final StringFields inherited from interface LanguageSupport
PROPERTY_LANGUAGE_PARSER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether closing tags should be automatically added when the user types a (non-self-closing) start tag.protected voidinstallKeyboardShortcuts(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Installs extra keyboard shortcuts supported by this language support.voidsetAutoAddClosingTags(boolean autoAdd) Sets whether closing tags should be automatically added when the user types a (non-self-closing) start tag.protected abstract booleanshouldAutoCloseTag(String tag) Subclasses should override this method to return whether a specified tag should have its closing tag auto-inserted.protected voiduninstallKeyboardShortcuts(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Uninstalls any keyboard shortcuts specific to this language support.Methods inherited from class AbstractLanguageSupport
createAutoCompletion, createDefaultCompletionCellRenderer, getAutoActivationDelay, getAutoCompletionFor, getDefaultCompletionCellRenderer, getShowDescWindow, getTextAreas, installImpl, isAutoActivationEnabled, isAutoCompleteEnabled, isParameterAssistanceEnabled, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setDefaultCompletionCellRenderer, setParameterAssistanceEnabled, setShowDescWindow, uninstallImplMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LanguageSupport
install, uninstall
-
Field Details
-
INSERT_CLOSING_TAG_ACTION
- See Also:
-
autoAddClosingTags
private boolean autoAddClosingTagsWhether closing tags are automatically added when the user types opening tags. For HTML, this will only occur for tags that are allowed to have closing tags, based on the doctype. For XML, this will always occur if this property is set totrue.
-
-
Constructor Details
-
AbstractMarkupLanguageSupport
protected AbstractMarkupLanguageSupport()
-
-
Method Details
-
getAutoAddClosingTags
public boolean getAutoAddClosingTags()Returns whether closing tags should be automatically added when the user types a (non-self-closing) start tag. This will only be done for tags where closing tags are accepted and valid, based on the doctype.- Returns:
- Whether to automatically add closing tags.
- See Also:
-
installKeyboardShortcuts
protected void installKeyboardShortcuts(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Installs extra keyboard shortcuts supported by this language support. The default implementation maps an action to automatically add closing tags when '>' is pressed; subclasses can override and add additional shortcuts if desired.Subclasses should call this method in their
LanguageSupport.install(RSyntaxTextArea)methods.- Parameters:
textArea- The text area to install the shortcuts into.- See Also:
-
shouldAutoCloseTag
Subclasses should override this method to return whether a specified tag should have its closing tag auto-inserted.- Parameters:
tag- The name of the tag to check.- Returns:
- Whether the tag should have its closing tag auto-inserted.
-
setAutoAddClosingTags
public void setAutoAddClosingTags(boolean autoAdd) Sets whether closing tags should be automatically added when the user types a (non-self-closing) start tag. This will only be done for tags where closing tags are accepted and valid, based on the doctype.- Parameters:
autoAdd- Whether to automatically add closing tags.- See Also:
-
uninstallKeyboardShortcuts
protected void uninstallKeyboardShortcuts(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Uninstalls any keyboard shortcuts specific to this language support.Subclasses should call this method in their
LanguageSupport.uninstall(RSyntaxTextArea)methods.- Parameters:
textArea- The text area to uninstall the actions from.- See Also:
-