Interface IFormatterParticipant
-
- All Known Implementing Classes:
ContentModelFormatterParticipant,XSIFormatterParticipant
public interface IFormatterParticipantXML formatter participant.- Author:
- Angelo ZERR
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default booleanformatAttributeValue(String name, String valueWithoutQuote, Character quote, DOMAttr attr, XMLBuilder xml)Format the given attribute value.default booleanformatAttributeValue(DOMAttr attr, XMLFormatterDocument formatterDocument, XMLFormattingConstraints parentConstraints, XMLFormattingOptions formattingOptions, List<org.eclipse.lsp4j.TextEdit> edits)Format the given attribute value.default FormatElementCategorygetFormatElementCategory(DOMElement element, XMLFormattingConstraints parentConstraints, Map<String,Collection<CMDocument>> formattingContext, SharedSettings sharedSettings)Returns the format element category for the given DOM element and null otherwise.default booleanshouldCollapseEmptyElement(DOMElement element, SharedSettings sharedSettings)Returns true if the given element can be collapsed according to grammar constraints.
-
-
-
Method Detail
-
formatAttributeValue
default boolean formatAttributeValue(String name, String valueWithoutQuote, Character quote, DOMAttr attr, XMLBuilder xml)
Format the given attribute value.The formatter must take care of to generate attribute value with quote.
- Parameters:
name- the attribute name.valueWithoutQuote- the attribute value without quote.quote- the quote and null otherwise. null quote means that the formatter must not generate a quote in the xml builder.attr- the DOM attribute and null otherwise.xml- the XML builder.- Returns:
- true if the given attribute can be formatted and false otherwise.
-
formatAttributeValue
default boolean formatAttributeValue(DOMAttr attr, XMLFormatterDocument formatterDocument, XMLFormattingConstraints parentConstraints, XMLFormattingOptions formattingOptions, List<org.eclipse.lsp4j.TextEdit> edits)
Format the given attribute value.- Parameters:
formatterDocument- the formatter documentindentLevel- the current indent level of the attributeformattingOptions- the formatting options that contain the settingsattr- the attribute nodeedits- the text edit list- Returns:
- true if the given attribute can be formatted and false otherwise.
-
getFormatElementCategory
default FormatElementCategory getFormatElementCategory(DOMElement element, XMLFormattingConstraints parentConstraints, Map<String,Collection<CMDocument>> formattingContext, SharedSettings sharedSettings)
Returns the format element category for the given DOM element and null otherwise.- Parameters:
element- the DOM element.parentConstraints- the parent constraints.sharedSettings- the shared settings.- Returns:
- the format element category for the given DOM element and null otherwise.
-
shouldCollapseEmptyElement
default boolean shouldCollapseEmptyElement(DOMElement element, SharedSettings sharedSettings)
Returns true if the given element can be collapsed according to grammar constraints.- Parameters:
element- the DOM element.sharedSettings- the shared settings.- Returns:
- true if the given element can be collapsed according to grammar constraints.
-
-