mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: cleanup - move check into util method
This commit is contained in:
committed by
Aleksey Pivovarov
parent
6212f5f31e
commit
aafb48929f
+11
-16
@@ -643,7 +643,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
saveComments(true);
|
||||
final DefaultListCleaner defaultListCleaner = new DefaultListCleaner();
|
||||
|
||||
final Runnable callCommit = new Runnable() {
|
||||
ensureDataIsActual(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
@@ -663,12 +663,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
ex.show();
|
||||
}
|
||||
}
|
||||
};
|
||||
if (myBrowser.isDataIsDirty()) {
|
||||
ensureDataIsActual(callCommit);
|
||||
} else {
|
||||
callCommit.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean addUnversionedFiles() {
|
||||
@@ -1179,8 +1174,13 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
}
|
||||
|
||||
private void ensureDataIsActual(final Runnable runnable) {
|
||||
ChangeListManager.getInstance(myProject).invokeAfterUpdate(runnable, InvokeAfterUpdateMode.SYNCHRONOUS_CANCELLABLE,
|
||||
"Refreshing changelists...", ModalityState.current());
|
||||
if (myBrowser.isDataIsDirty()) {
|
||||
ChangeListManager.getInstance(myProject).invokeAfterUpdate(runnable, InvokeAfterUpdateMode.SYNCHRONOUS_CANCELLABLE,
|
||||
"Refreshing changelists...", ModalityState.current());
|
||||
}
|
||||
else {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
private class CommitExecutorAction extends AbstractAction {
|
||||
@@ -1193,17 +1193,12 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
final Runnable callExecutor = new Runnable() {
|
||||
ensureDataIsActual(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
execute(myCommitExecutor);
|
||||
}
|
||||
};
|
||||
if (myBrowser.isDataIsDirty()) {
|
||||
ensureDataIsActual(callExecutor);
|
||||
} else {
|
||||
callExecutor.run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void updateEnabled(boolean hasDiffs) {
|
||||
|
||||
Reference in New Issue
Block a user