mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
changes view toolwindow refactored to use bean: no initial availability check
This commit is contained in:
@@ -41,8 +41,7 @@
|
|||||||
<colorAndFontDescriptorProvider implementation="com.intellij.openapi.vcs.actions.VcsColorsPageFactory"/>
|
<colorAndFontDescriptorProvider implementation="com.intellij.openapi.vcs.actions.VcsColorsPageFactory"/>
|
||||||
|
|
||||||
<toolWindow id="Version Control" anchor="bottom" canCloseContents="true" icon="AllIcons.Toolwindows.ToolWindowChanges"
|
<toolWindow id="Version Control" anchor="bottom" canCloseContents="true" icon="AllIcons.Toolwindows.ToolWindowChanges"
|
||||||
factoryClass="com.intellij.openapi.vcs.changes.ui.ChangesViewToolWindowFactory"
|
factoryClass="com.intellij.openapi.vcs.changes.ui.ChangesViewToolWindowFactory"/>
|
||||||
conditionClass="com.intellij.openapi.vcs.changes.ui.ChangesViewToolWindowFactory"/>
|
|
||||||
|
|
||||||
<changesViewContent tabName="Repository" className="com.intellij.openapi.vcs.changes.committed.CommittedChangesViewManager"
|
<changesViewContent tabName="Repository" className="com.intellij.openapi.vcs.changes.committed.CommittedChangesViewManager"
|
||||||
predicateClassName="com.intellij.openapi.vcs.changes.committed.CommittedChangesVisibilityPredicate"/>
|
predicateClassName="com.intellij.openapi.vcs.changes.committed.CommittedChangesVisibilityPredicate"/>
|
||||||
|
|||||||
+1
-9
@@ -17,8 +17,6 @@ package com.intellij.openapi.vcs.changes.ui;
|
|||||||
|
|
||||||
import com.intellij.openapi.project.DumbAware;
|
import com.intellij.openapi.project.DumbAware;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.util.Condition;
|
|
||||||
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
|
|
||||||
import com.intellij.openapi.wm.ToolWindow;
|
import com.intellij.openapi.wm.ToolWindow;
|
||||||
import com.intellij.openapi.wm.ToolWindowFactory;
|
import com.intellij.openapi.wm.ToolWindowFactory;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -26,15 +24,9 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
/**
|
/**
|
||||||
* @author Dmitry Avdeev
|
* @author Dmitry Avdeev
|
||||||
*/
|
*/
|
||||||
public class ChangesViewToolWindowFactory implements ToolWindowFactory, DumbAware, Condition<Project> {
|
public class ChangesViewToolWindowFactory implements ToolWindowFactory, DumbAware {
|
||||||
@Override
|
@Override
|
||||||
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
|
public void createToolWindowContent(@NotNull Project project, @NotNull ToolWindow toolWindow) {
|
||||||
ChangesViewContentManager.getInstance(project).setUp(toolWindow);
|
ChangesViewContentManager.getInstance(project).setUp(toolWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean value(Project project) {
|
|
||||||
ProjectLevelVcsManager manager = ProjectLevelVcsManager.getInstance(project);
|
|
||||||
return manager.getAllActiveVcss().length > 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,9 +107,6 @@ public class NewMappings {
|
|||||||
|
|
||||||
public AbstractVcs[] getActiveVcses() {
|
public AbstractVcs[] getActiveVcses() {
|
||||||
synchronized (myLock) {
|
synchronized (myLock) {
|
||||||
if (!myActivated) {
|
|
||||||
activateActiveVcses();
|
|
||||||
}
|
|
||||||
final AbstractVcs[] result = new AbstractVcs[myActiveVcses.length];
|
final AbstractVcs[] result = new AbstractVcs[myActiveVcses.length];
|
||||||
System.arraycopy(myActiveVcses, 0, result, 0, myActiveVcses.length);
|
System.arraycopy(myActiveVcses, 0, result, 0, myActiveVcses.length);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user