|
org.netbeans.modules.editor.indent/2 1.15.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.modules.editor.indent.api.Reformat
public final class Reformat
Reformatting of a block of code in a document.
The following pattern should be used:
reformat.lock();
try {
doc.atomicLock();
try {
reformat.reformat(...);
} finally {
doc.atomicUnlock();
}
} finally {
reformat.unlock();
}
| Method Summary | |
|---|---|
static Reformat |
get(Document doc)
Get the reformatting for the given document. |
void |
lock()
Clients should call this method before acquiring of document's write lock. |
void |
reformat(int startOffset,
int endOffset)
Reformat a given range of code in the given document. |
void |
unlock()
Clients should call this method after releasing of document's write lock. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Reformat get(Document doc)
doc - non-null document.
public void lock()
reformat.lock();
try {
doc.atomicLock();
try {
reformat.reformat(...);
} finally {
doc.atomicUnlock();
}
} finally {
reformat.unlock();
}
public void unlock()
reformat.lock();
try {
doc.atomicLock();
try {
reformat.reformat(...);
} finally {
doc.atomicUnlock();
}
} finally {
reformat.unlock();
}
public void reformat(int startOffset,
int endOffset)
throws BadLocationException
If the reformatter implementation is not available the reindentation will be performed (i.e. just the line indentation will be fixed) as a closest match.
startOffset - start offset of the area to be reformatted.endOffset - end offset of the area to be reformatted.
BadLocationException
|
org.netbeans.modules.editor.indent/2 1.15.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||