mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
lst: extract method
This commit is contained in:
@@ -268,10 +268,14 @@ public class LineStatusTracker {
|
||||
|
||||
public boolean isValid() {
|
||||
synchronized (LOCK) {
|
||||
return myInitialized && !myReleased && !myAnathemaThrown && !myBulkUpdate && !myDuringRollback && myDirtyRange == null;
|
||||
return !isSuppressed() && myDirtyRange == null;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSuppressed() {
|
||||
return !myInitialized || myReleased || myAnathemaThrown || myBulkUpdate || myDuringRollback;
|
||||
}
|
||||
|
||||
public void release() {
|
||||
UIUtil.invokeLaterIfNeeded(() -> {
|
||||
if (myReleased) return;
|
||||
@@ -368,7 +372,7 @@ public class LineStatusTracker {
|
||||
private class MyApplicationListener extends ApplicationAdapter {
|
||||
@Override
|
||||
public void writeActionFinished(@NotNull Object action) {
|
||||
if (!myInitialized || myReleased || myBulkUpdate || myDuringRollback || myAnathemaThrown) return;
|
||||
if (isSuppressed()) return;
|
||||
if (myDirtyRange != null) {
|
||||
synchronized (LOCK) {
|
||||
try {
|
||||
@@ -408,8 +412,7 @@ public class LineStatusTracker {
|
||||
|
||||
@Override
|
||||
public void beforeDocumentChange(DocumentEvent e) {
|
||||
if (!myInitialized || myReleased) return;
|
||||
if (myBulkUpdate || myDuringRollback || myAnathemaThrown) return;
|
||||
if (isSuppressed()) return;
|
||||
assert myDocument == e.getDocument();
|
||||
|
||||
myLine1 = myDocument.getLineNumber(e.getOffset());
|
||||
@@ -427,8 +430,7 @@ public class LineStatusTracker {
|
||||
public void documentChanged(final DocumentEvent e) {
|
||||
myApplication.assertIsDispatchThread();
|
||||
|
||||
if (!myInitialized || myReleased) return;
|
||||
if (myBulkUpdate || myDuringRollback || myAnathemaThrown) return;
|
||||
if (isSuppressed()) return;
|
||||
assert myDocument == e.getDocument();
|
||||
|
||||
synchronized (LOCK) {
|
||||
|
||||
Reference in New Issue
Block a user