mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] rename VcsLogProjectManager -> VcsProjectLog
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<changesViewContent tabName="Log" className="com.intellij.vcs.log.impl.VcsLogContentProvider"
|
||||
predicateClassName="com.intellij.vcs.log.impl.VcsLogContentProvider$VcsLogVisibilityPredicate"/>
|
||||
|
||||
<projectService serviceImplementation="com.intellij.vcs.log.impl.VcsLogProjectManager"/>
|
||||
<projectService serviceImplementation="com.intellij.vcs.log.impl.VcsProjectLog"/>
|
||||
<projectService serviceInterface="com.intellij.vcs.log.VcsLogObjectsFactory"
|
||||
serviceImplementation="com.intellij.vcs.log.impl.VcsLogObjectsFactoryImpl"/>
|
||||
<projectService serviceInterface="com.intellij.vcs.log.VcsLogSettings"
|
||||
@@ -28,7 +28,7 @@
|
||||
<logHighlighterFactory implementation="com.intellij.vcs.log.ui.MergeCommitsHighlighter$Factory"/>
|
||||
<logHighlighterFactory implementation="com.intellij.vcs.log.ui.CurrentBranchHighlighter$Factory"/>
|
||||
|
||||
<postStartupActivity implementation="com.intellij.vcs.log.impl.VcsLogProjectManager$InitLogStartupActivity"/>
|
||||
<postStartupActivity implementation="com.intellij.vcs.log.impl.VcsProjectLog$InitLogStartupActivity"/>
|
||||
</extensions>
|
||||
|
||||
<actions>
|
||||
|
||||
@@ -50,15 +50,15 @@ public class VcsLogContentProvider implements ChangesViewContentProvider {
|
||||
public static final String TAB_NAME = "Log";
|
||||
|
||||
@NotNull private final Project myProject;
|
||||
@NotNull private final VcsLogProjectManager myLogManager;
|
||||
@NotNull private final VcsProjectLog myProjectLog;
|
||||
@NotNull private final JPanel myContainer = new JBPanel(new BorderLayout());
|
||||
|
||||
public VcsLogContentProvider(@NotNull Project project, @NotNull VcsLogProjectManager logManager) {
|
||||
public VcsLogContentProvider(@NotNull Project project, @NotNull VcsProjectLog projectLog) {
|
||||
myProject = project;
|
||||
myLogManager = logManager;
|
||||
myProjectLog = projectLog;
|
||||
|
||||
MessageBusConnection connection = project.getMessageBus().connect(project);
|
||||
connection.subscribe(VcsLogProjectManager.VCS_PROJECT_LOG_CHANGED, new VcsLogProjectManager.ProjectLogListener() {
|
||||
connection.subscribe(VcsProjectLog.VCS_PROJECT_LOG_CHANGED, new VcsProjectLog.ProjectLogListener() {
|
||||
@Override
|
||||
public void logCreated() {
|
||||
addLogUi();
|
||||
@@ -71,23 +71,23 @@ public class VcsLogContentProvider implements ChangesViewContentProvider {
|
||||
}
|
||||
});
|
||||
|
||||
if (myLogManager.getLogManager() != null) {
|
||||
if (myProjectLog.getLogManager() != null) {
|
||||
addLogUi();
|
||||
}
|
||||
}
|
||||
|
||||
@CalledInAwt
|
||||
private void addLogUi() {
|
||||
myContainer.add(myLogManager.initMainLog(TAB_NAME), BorderLayout.CENTER);
|
||||
myContainer.add(myProjectLog.initMainLog(TAB_NAME), BorderLayout.CENTER);
|
||||
|
||||
VcsLogManager manager = myLogManager.getLogManager();
|
||||
VcsLogManager manager = myProjectLog.getLogManager();
|
||||
assert manager != null;
|
||||
if (manager.isLogVisible()) myLogManager.scheduleInitialization();
|
||||
if (manager.isLogVisible()) myProjectLog.scheduleInitialization();
|
||||
}
|
||||
|
||||
@Override
|
||||
public JComponent initContent() {
|
||||
myLogManager.scheduleInitialization();
|
||||
myProjectLog.scheduleInitialization();
|
||||
return myContainer;
|
||||
}
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ public class VcsLogManager implements Disposable {
|
||||
@Nullable
|
||||
@Deprecated
|
||||
public static VcsLogManager getInstance(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, VcsLogProjectManager.class).getLogManager();
|
||||
return ServiceManager.getService(project, VcsProjectLog.class).getLogManager();
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -193,7 +193,7 @@ public class VcsLogManager implements Disposable {
|
||||
@Nullable
|
||||
@Deprecated
|
||||
public VcsLogUiImpl getMainLogUi() {
|
||||
return ServiceManager.getService(myProject, VcsLogProjectManager.class).getMainLogUi();
|
||||
return ServiceManager.getService(myProject, VcsProjectLog.class).getMainLogUi();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+8
-8
@@ -40,7 +40,7 @@ import javax.swing.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
||||
public class VcsLogProjectManager {
|
||||
public class VcsProjectLog {
|
||||
public static final Topic<ProjectLogListener> VCS_PROJECT_LOG_CHANGED =
|
||||
Topic.create("Project Vcs Log Created or Disposed", ProjectLogListener.class);
|
||||
@NotNull private final Project myProject;
|
||||
@@ -51,7 +51,7 @@ public class VcsLogProjectManager {
|
||||
private final LazyVcsLogManager myLogManager = new LazyVcsLogManager();
|
||||
private volatile VcsLogUiImpl myUi;
|
||||
|
||||
public VcsLogProjectManager(@NotNull Project project, @NotNull VcsLogTabsProperties uiProperties) {
|
||||
public VcsProjectLog(@NotNull Project project, @NotNull VcsLogTabsProperties uiProperties) {
|
||||
myProject = project;
|
||||
myMessageBus = project.getMessageBus();
|
||||
myUiProperties = uiProperties;
|
||||
@@ -134,8 +134,8 @@ public class VcsLogProjectManager {
|
||||
return !VcsLogManager.findLogProviders(getVcsRoots(), myProject).isEmpty();
|
||||
}
|
||||
|
||||
public static VcsLogProjectManager getInstance(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, VcsLogProjectManager.class);
|
||||
public static VcsProjectLog getInstance(@NotNull Project project) {
|
||||
return ServiceManager.getService(project, VcsProjectLog.class);
|
||||
}
|
||||
|
||||
@SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
|
||||
@@ -176,20 +176,20 @@ public class VcsLogProjectManager {
|
||||
public static class InitLogStartupActivity implements StartupActivity {
|
||||
@Override
|
||||
public void runActivity(@NotNull Project project) {
|
||||
VcsLogProjectManager logProjectManager = getInstance(project);
|
||||
VcsProjectLog projectLog = getInstance(project);
|
||||
|
||||
MessageBusConnection connection = project.getMessageBus().connect(project);
|
||||
connection.subscribe(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED, new VcsListener() {
|
||||
@Override
|
||||
public void directoryMappingChanged() {
|
||||
logProjectManager.recreateLog();
|
||||
projectLog.recreateLog();
|
||||
}
|
||||
});
|
||||
if (logProjectManager.hasDvcsRoots()) {
|
||||
if (projectLog.hasDvcsRoots()) {
|
||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
logProjectManager.createLog();
|
||||
projectLog.createLog();
|
||||
}
|
||||
});
|
||||
}
|
||||
+3
-3
@@ -29,7 +29,7 @@ import com.intellij.vcs.log.VcsLogProvider;
|
||||
import com.intellij.vcs.log.data.DataPack;
|
||||
import com.intellij.vcs.log.data.VcsLogDataManager;
|
||||
import com.intellij.vcs.log.graph.PermanentGraph;
|
||||
import com.intellij.vcs.log.impl.VcsLogProjectManager;
|
||||
import com.intellij.vcs.log.impl.VcsProjectLog;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -46,8 +46,8 @@ public class VcsLogRepoSizeCollector extends AbstractApplicationUsagesCollector
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<UsageDescriptor> getProjectUsages(@NotNull Project project) throws CollectUsagesException {
|
||||
VcsLogProjectManager logManager = VcsLogProjectManager.getInstance(project);
|
||||
VcsLogDataManager dataManager = logManager.getDataManager();
|
||||
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
|
||||
VcsLogDataManager dataManager = projectLog.getDataManager();
|
||||
if (dataManager != null) {
|
||||
DataPack dataPack = dataManager.getDataPack();
|
||||
if (dataPack.isFull()) {
|
||||
|
||||
+3
-3
@@ -23,7 +23,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.vcs.log.impl.VcsLogContentProvider;
|
||||
import com.intellij.vcs.log.impl.VcsLogManager;
|
||||
import com.intellij.vcs.log.impl.VcsLogProjectManager;
|
||||
import com.intellij.vcs.log.impl.VcsProjectLog;
|
||||
import com.intellij.vcs.log.ui.VcsLogDataKeys;
|
||||
|
||||
public class OpenAnotherLogTabAction extends DumbAwareAction {
|
||||
@@ -38,10 +38,10 @@ public class OpenAnotherLogTabAction extends DumbAwareAction {
|
||||
e.getPresentation().setEnabledAndVisible(false);
|
||||
return;
|
||||
}
|
||||
VcsLogProjectManager logProjectManager = VcsLogProjectManager.getInstance(project);
|
||||
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
|
||||
VcsLogManager logManager = e.getData(VcsLogDataKeys.LOG_MANAGER);
|
||||
e.getPresentation()
|
||||
.setEnabledAndVisible(logManager != null && logProjectManager.getLogManager() == logManager); // only for main log (it is a question, how and where we want to open tabs for external logs)
|
||||
.setEnabledAndVisible(logManager != null && projectLog.getLogManager() == logManager); // only for main log (it is a question, how and where we want to open tabs for external logs)
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,7 @@ import com.intellij.ui.content.Content;
|
||||
import com.intellij.ui.content.ContentManager;
|
||||
import com.intellij.vcs.log.VcsLog;
|
||||
import com.intellij.vcs.log.impl.VcsLogContentProvider;
|
||||
import com.intellij.vcs.log.impl.VcsLogProjectManager;
|
||||
import com.intellij.vcs.log.impl.VcsProjectLog;
|
||||
import com.intellij.vcs.log.ui.VcsLogUiImpl;
|
||||
import git4idea.GitVcs;
|
||||
import git4idea.i18n.GitBundle;
|
||||
@@ -106,12 +106,12 @@ public class GitShowCommitInLogAction extends DumbAwareAction {
|
||||
return;
|
||||
}
|
||||
|
||||
VcsLogProjectManager logManager = VcsLogProjectManager.getInstance(project);
|
||||
if (logManager == null) {
|
||||
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
|
||||
if (projectLog == null) {
|
||||
showLogNotReadyMessage(project);
|
||||
return;
|
||||
}
|
||||
VcsLogUiImpl logUi = logManager.getMainLogUi();
|
||||
VcsLogUiImpl logUi = projectLog.getMainLogUi();
|
||||
if (logUi == null) {
|
||||
showLogNotReadyMessage(project);
|
||||
return;
|
||||
@@ -145,16 +145,16 @@ public class GitShowCommitInLogAction extends DumbAwareAction {
|
||||
super.update(e);
|
||||
Project project = e.getProject();
|
||||
e.getPresentation().setEnabled(project != null &&
|
||||
VcsLogProjectManager.getInstance(project) != null &&
|
||||
VcsProjectLog.getInstance(project) != null &&
|
||||
getRevisionNumber(e) != null &&
|
||||
Comparing.equal(getVcsKey(e), GitVcs.getKey()));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private static VcsLog findLog(@NotNull Project project) {
|
||||
VcsLogProjectManager manager = VcsLogProjectManager.getInstance(project);
|
||||
if (manager != null) {
|
||||
VcsLogUiImpl ui = manager.getMainLogUi();
|
||||
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
|
||||
if (projectLog != null) {
|
||||
VcsLogUiImpl ui = projectLog.getMainLogUi();
|
||||
if (ui != null) {
|
||||
return ui.getVcsLog();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user