Class XmlLanguageSupport
java.lang.Object
org.fife.rsta.ac.AbstractLanguageSupport
org.fife.rsta.ac.AbstractMarkupLanguageSupport
org.fife.rsta.ac.xml.XmlLanguageSupport
- All Implemented Interfaces:
LanguageSupport
Language support for XML. Currently supported features include:
- Squiggle underlining of basic XML structure errors.
- Usage of
XmlOutlineTree, a tree view modeling the XML in theRSyntaxTextArea.
- DTD/Schema validation.
- Code completion based off of other tags in the XML.
- Code completion based off of the relevant DTD or schema.
- Version:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate XmlCompletionProviderThe shared completion provider instance for all XML editors.private booleanWhether syntax errors are squiggle-underlined in the editor.Fields inherited from class AbstractMarkupLanguageSupport
INSERT_CLOSING_TAG_ACTIONFields inherited from interface LanguageSupport
PROPERTY_LANGUAGE_PARSER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ListCellRenderer<Object> Creates the default cell renderer to use when none is specified.getParser(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Returns the XML parser running on a text area with this XML language support installed.private XmlCompletionProviderLazily creates the shared completion provider instance for XML.booleanReturns whether syntax errors are squiggle-underlined in the editor.voidinstall(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Installs this support.protected voidinstallKeyboardShortcuts(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Installs extra keyboard shortcuts supported by this language support.voidsetShowSyntaxErrors(boolean show) Sets whether syntax errors are squiggle-underlined in the editor.protected booleanshouldAutoCloseTag(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.protected voiduninstallKeyboardShortcuts(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Uninstalls any keyboard shortcuts specific to this language support.Methods inherited from class AbstractMarkupLanguageSupport
getAutoAddClosingTags, setAutoAddClosingTagsMethods inherited from class AbstractLanguageSupport
createAutoCompletion, getAutoActivationDelay, getAutoCompletionFor, getDefaultCompletionCellRenderer, getShowDescWindow, getTextAreas, installImpl, isAutoActivationEnabled, isAutoCompleteEnabled, isParameterAssistanceEnabled, setAutoActivationDelay, setAutoActivationEnabled, setAutoCompleteEnabled, setDefaultCompletionCellRenderer, setParameterAssistanceEnabled, setShowDescWindow, uninstallImpl
-
Field Details
-
provider
The shared completion provider instance for all XML editors. -
showSyntaxErrors
private boolean showSyntaxErrorsWhether syntax errors are squiggle-underlined in the editor.
-
-
Constructor Details
-
XmlLanguageSupport
public XmlLanguageSupport()Constructor.
-
-
Method Details
-
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
Lazily creates the shared completion provider instance for XML.- Returns:
- The completion provider.
-
getParser
Returns the XML parser running on a text area with this XML language support installed.- Parameters:
textArea- The text area.- Returns:
- The XML parser. This will be
nullif the text area does not have this XmlLanguageSupport installed.
-
getShowSyntaxErrors
public boolean getShowSyntaxErrors()Returns whether syntax errors are squiggle-underlined in the editor.- Returns:
- Whether errors are squiggle-underlined.
- See Also:
-
install
public void install(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea textArea) Installs this support.- Parameters:
textArea- The text area to install onto.- 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.- Overrides:
installKeyboardShortcutsin classAbstractMarkupLanguageSupport- Parameters:
textArea- The text area to install the shortcuts into.- See Also:
-
setShowSyntaxErrors
public void setShowSyntaxErrors(boolean show) Sets whether syntax errors are squiggle-underlined in the editor.- Parameters:
show- Whether syntax errors are squiggle-underlined.- See Also:
-
shouldAutoCloseTag
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:
-
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.- Overrides:
uninstallKeyboardShortcutsin classAbstractMarkupLanguageSupport- Parameters:
textArea- The text area to uninstall the actions from.- See Also:
-