Added factory method to the Update

IDEA-CR-26236
This commit is contained in:
Alexandr Evstigneev
2017-11-07 16:36:44 +03:00
parent afb46f9fa9
commit 4ab0174fd7
@@ -16,6 +16,7 @@
package com.intellij.util.ui.update;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
@@ -99,4 +100,13 @@ public abstract class Update extends ComparableObject.Impl implements Runnable {
public boolean isRejected() {
return myRejected;
}
public static Update create(@NonNls Object identity, @NotNull Runnable runnable) {
return new Update(identity) {
@Override
public void run() {
runnable.run();
}
};
}
}