[vcs-log] provide recreate main log handler in constructor

This commit is contained in:
Julia Beliaeva
2016-05-05 19:03:00 +03:00
parent 5bbddcbcad
commit 283fa77c38
2 changed files with 10 additions and 8 deletions
@@ -54,8 +54,7 @@ public class VcsLogManager implements Disposable {
@NotNull private final Project myProject;
@NotNull private final VcsLogTabsProperties myUiProperties;
@Nullable private Runnable myRecreateMainLogHandler;
@Nullable private final Runnable myRecreateMainLogHandler;
private volatile VcsLogUiImpl myUi;
@NotNull private final VcsLogDataManager myDataManager;
@@ -64,8 +63,16 @@ public class VcsLogManager implements Disposable {
@NotNull private final PostponableLogRefresher myPostponableRefresher;
public VcsLogManager(@NotNull Project project, @NotNull VcsLogTabsProperties uiProperties, @NotNull Collection<VcsRoot> roots) {
this(project, uiProperties, roots, null);
}
public VcsLogManager(@NotNull Project project,
@NotNull VcsLogTabsProperties uiProperties,
@NotNull Collection<VcsRoot> roots,
@Nullable Runnable recreateHandler) {
myProject = project;
myUiProperties = uiProperties;
myRecreateMainLogHandler = recreateHandler;
Map<VirtualFile, VcsLogProvider> logProviders = findLogProviders(roots, myProject);
myDataManager = new VcsLogDataManager(myProject, logProviders, new MyFatalErrorsConsumer());
@@ -151,10 +158,6 @@ public class VcsLogManager implements Disposable {
return logProviders;
}
public void setRecreateMainLogHandler(@Nullable Runnable recreateMainLogHandler) {
myRecreateMainLogHandler = recreateMainLogHandler;
}
/**
* The instance of the {@link VcsLogUiImpl} or null if the log was not initialized yet.
*/
@@ -59,8 +59,7 @@ public class VcsLogProjectManager {
public boolean initData() {
if (myLogManager != null) return true;
myLogManager = new VcsLogManager(myProject, myUiProperties, getVcsRoots());
myLogManager.setRecreateMainLogHandler(myRecreateMainLogHandler);
myLogManager = new VcsLogManager(myProject, myUiProperties, getVcsRoots(), myRecreateMainLogHandler);
return false;
}