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

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


public interface IndentTask

Indent task performs indentation on a single or multiple lines.
Typically it is used to fix indentation after newline was inserted or to fix indentation for a selected block of code. 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 IndentTask.Factory
          Indent task factory produces indent tasks for the given context.
 
Method Summary
 ExtraLock indentLock()
          Get an extra locking or null if no extra locking is necessary.
 void reindent()
          Perform reindentation of the line(s) of Context.document() between Context.startOffset() and Context.endOffset().
 

Method Detail

reindent

void reindent()
              throws BadLocationException
Perform reindentation of the line(s) of Context.document() between Context.startOffset() and Context.endOffset().
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 indent task attempted to insert/remove at an invalid offset or e.g. into a guarded section.

indentLock

ExtraLock indentLock()
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.