org.netbeans.modules.editor.indent/2 1.28

org.netbeans.modules.editor.indent.spi
Interface ReformatTask


public interface ReformatTask

Reformat task performs actual reformatting within offset bounds of the given context. Since org.netbeans.modules.editor.indent/2 1.12 classes implementing this interface can implement also Lookup.Provider and provide a lookup which will be available to formatters via Context.getLookup().


Nested Class Summary
static interface ReformatTask.Factory
          Reformat task factory produces reformat tasks for the given context.
 
Method Summary
 void reformat()
          Perform reformatting of the Context.document() between Context.startOffset() and Context.endOffset().
 ExtraLock reformatLock()
          Get an extra locking or null if no extra locking is necessary.
 

Method Detail

reformat

void reformat()
              throws BadLocationException
Perform reformatting of the Context.document() between Context.startOffset() and Context.endOffset().
This method may be called several times repetitively for different areas of a reformatted area.
It is called from AWT thread and it should process synchronously. It is used after a newline is inserted after the user presses Enter or when a current line must be reindented e.g. when Tab is pressed in emacs mode.
The method should use information from the context and modify indentation at the given offset in the document.

Throws:
BadLocationException - in case the formatter attempted to insert/remove at an invalid offset or e.g. into a guarded section.

reformatLock

ExtraLock reformatLock()
Get an extra locking or null if no extra locking is necessary.


org.netbeans.modules.editor.indent/2 1.28

Built on May 22 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.