Class FormatterServiceDelegate
java.lang.Object
de.funfried.netbeans.plugins.external.formatter.FormatterServiceDelegate
Singleton delegation class for calling the activated external formatter, if no external formatter is
activated nothing will be done by this implementation. There is no fallback to the internal NetBeans
formatter in here!
- Author:
- markiewb, bahlef
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Formats the givenStyledDocument
in regard to the givenchangedElements
.getContinuationIndentSize
(Document document) Returns the continuation indent size configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
.getIndentSize
(Document document) Returns the indent size configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
.static FormatterServiceDelegate
Returns the singleton instance ofFormatterServiceDelegate
.getRightMargin
(Document document) Returns the right margin (position of the red line in the editor) configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
.getSpacesPerTab
(Document document) Returns the spaces per tab configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
.isExpandTabToSpaces
(Document document) Returns the expand tab to spaces flag configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
.organizeImports
(StyledDocument document, boolean afterFixImports)
-
Method Details
-
getInstance
Returns the singleton instance ofFormatterServiceDelegate
.- Returns:
- the singleton instance
-
format
Formats the givenStyledDocument
in regard to the givenchangedElements
.- Parameters:
document
- theStyledDocument
which should be formattedchangedElements
- aSortedSet
containing ranges asPair
objects that should be formatted- Returns:
true
if and only if a external formatter was found to handle the givenStyledDocument
even if there was an error while formatting, otherwise and if an external formatter delegates formatting to the NetBeans formatter it isfalse
-
getContinuationIndentSize
Returns the continuation indent size configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
. -
getIndentSize
Returns the indent size configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
. -
getRightMargin
Returns the right margin (position of the red line in the editor) configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
. -
getSpacesPerTab
Returns the spaces per tab configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
. -
isExpandTabToSpaces
Returns the expand tab to spaces flag configured by the formatter which is activated for the givenDocument
, ornull
if the internal NetBeans code formatter is used for the givendocument
. -
organizeImports
-