Package org.fife.rsta.ac
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
public abstract class AbstractMarkupLanguageSupport extends AbstractLanguageSupport
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 Classes Modifier and Type Class Description private classAbstractMarkupLanguageSupport.InsertClosingTagActionAction that checks whether a closing tag should be auto-inserted into the document.
-
Field Summary
Fields Modifier and Type Field Description private booleanautoAddClosingTagsWhether closing tags are automatically added when the user types opening tags.protected static java.lang.StringINSERT_CLOSING_TAG_ACTION-
Fields inherited from interface org.fife.rsta.ac.LanguageSupport
PROPERTY_LANGUAGE_PARSER
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMarkupLanguageSupport()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleangetAutoAddClosingTags()Returns 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(java.lang.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 org.fife.rsta.ac.AbstractLanguageSupport
createAutoCompletion, createDefaultCompletionCellRenderer, getAutoActivationDelay, getAutoCompletionFor, getDefaultCompletionCellRenderer, getShowDescWindow, getTextAreas, installImpl, isAutoActivationEnabled, isAutoCompleteEnabled, isParameterAssistanceEnabled, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setDefaultCompletionCellRenderer, setParameterAssistanceEnabled, setShowDescWindow, uninstallImpl
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.fife.rsta.ac.LanguageSupport
install, uninstall
-
-
-
-
Field Detail
-
INSERT_CLOSING_TAG_ACTION
protected static final java.lang.String INSERT_CLOSING_TAG_ACTION
- See Also:
- Constant Field Values
-
autoAddClosingTags
private boolean autoAddClosingTags
Whether 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.
-
-
Method Detail
-
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:
setAutoAddClosingTags(boolean)
-
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:
uninstallKeyboardShortcuts(RSyntaxTextArea)
-
shouldAutoCloseTag
protected abstract boolean shouldAutoCloseTag(java.lang.String tag)
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:
getAutoAddClosingTags()
-
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:
installKeyboardShortcuts(RSyntaxTextArea)
-
-