public abstract class AbstractLanguageSupport extends java.lang.Object implements LanguageSupport
AbstractLanguageSupport is the base class for all LanguageSupports provided with this editor component. It takes care of implementing common functionality.PROPERTY_LINE_COMMENT_START| Constructor and Description |
|---|
AbstractLanguageSupport() |
| Modifier and Type | Method and Description |
|---|---|
protected BraceProvider |
createBraceProvider()
Creates a new
BraceProvider for performing brace matching for this document. |
protected abstract DocumentRenderer |
createDocumentRenderer()
Creates the
DocumentRenderer for rendering the given document. |
protected OffsetDescriptionProvider |
createOffsetDescriptionProvider()
Creates a new
OffsetDescriptionProvider for translating text buffer offsets into language specific user readable descriptions of the location. |
protected SmartIndentProvider |
createSmartIndentProvider()
Creates a new
SmartIndentProvider for performing smart indentation for this language. |
protected WordLocator |
createWordLocator()
Creates a new
WordLocator for defining word boundaries that make sense for a given language. |
void |
deinstall()
Disassociates this instance from a specific document.
|
BraceProvider |
getBraceProvider()
Fetches the
BraceProvider for performing brace matching for this document. |
BasicDocument |
getDocument()
Fetches the document associated with this
LanguageSupport instance. |
DocumentRenderer |
getDocumentRenderer()
Fetches the
DocumentRenderer for rendering the given document. |
OffsetDescriptionProvider |
getOffsetDescriptionProvider()
Fetches the
OffsetDescriptionProvider to use to translate offsets to language specific user readible Strings. |
java.lang.Object |
getProperty(java.lang.String key)
Gets language-specific properties.
|
protected java.lang.Object |
getPropertyImpl(java.lang.String key)
Fetch the language-specific properties.
|
SmartIndentProvider |
getSmartIndentProvider()
Fetches the
SmartIndentProvider to use for performing smart indentation. |
WordLocator |
getWordLocator()
Fetches the
WordLocator to use for locating word boundaries for word-based navigator. |
void |
install(BasicDocument document)
Associates this
LanguageSupport instance with a specific document. |
public void install(BasicDocument document)
LanguageSupport instance with a specific document. This is useful for example if there are caches maintained for this document.install in interface LanguageSupportdocument - the documentpublic void deinstall()
deinstall in interface LanguageSupportpublic final BasicDocument getDocument()
LanguageSupport instance.getDocument in interface LanguageSupportpublic final java.lang.Object getProperty(java.lang.String key)
getProperty in interface LanguageSupportkey - a non-null propertyprotected java.lang.Object getPropertyImpl(java.lang.String key)
key - a non-null propertypublic final DocumentRenderer getDocumentRenderer()
DocumentRenderer for rendering the given document. Note that all implementations are required to provide a DocumentRenderer.getDocumentRenderer in interface LanguageSupportDocumentRenderer that will be used for rendering (syntax-highlighting) the given document contentpublic final BraceProvider getBraceProvider()
BraceProvider for performing brace matching for this document.getBraceProvider in interface LanguageSupportBraceProvider for brace matching, or null if brace matching is not supported for this language.public WordLocator getWordLocator()
WordLocator to use for locating word boundaries for word-based navigator. Implementations may override this to use their own custom word locator instead of the default one based on the natural language word locator based on the JDK's word break iterator.getWordLocator in interface LanguageSupportWordLocatorpublic SmartIndentProvider getSmartIndentProvider()
SmartIndentProvider to use for performing smart indentation.getSmartIndentProvider in interface LanguageSupportSmartIndentProvider for this languagepublic OffsetDescriptionProvider getOffsetDescriptionProvider()
OffsetDescriptionProvider to use to translate offsets to language specific user readible Strings.protected abstract DocumentRenderer createDocumentRenderer()
DocumentRenderer for rendering the given document. Note that all implementations are required to provide a DocumentRenderer.DocumentRenderer that will be used for rendering (syntax-highlighting) the given document contentprotected BraceProvider createBraceProvider()
BraceProvider for performing brace matching for this document.BraceProvider for brace matching, or null if brace matching is not supported for this language.protected WordLocator createWordLocator()
WordLocator for defining word boundaries that make sense for a given language. The default one uses the JDK's break iterator for natural word boundaries.WordLocator for locating word boundariesprotected SmartIndentProvider createSmartIndentProvider()
SmartIndentProvider for performing smart indentation for this language.SmartIndentProvider, or null if this language does not support smart indentationprotected OffsetDescriptionProvider createOffsetDescriptionProvider()
OffsetDescriptionProvider for translating text buffer offsets into language specific user readable descriptions of the location.