vcs: Rename/move some "committed changes"-related logic

* rename "AbstractVcsHelper.showChangesBrowser()" to "showCommittedChangesBrowser()"
* rename "BrowseChangesAction" to "BrowseCommittedChangesAction"
* move "BrowseCommittedChangesAction" located in [vcs.impl] to "com.intellij.openapi.vcs.changes.committed" package

GitOrigin-RevId: 81ee0027fd381c613bf540385388613cd8746329
This commit is contained in:
Konstantin Kolosovsky
2019-12-21 19:41:55 +00:00
committed by intellij-monorepo-bot
parent 449465ed96
commit 1b02f56cba
8 changed files with 46 additions and 49 deletions
@@ -274,7 +274,7 @@
icon="AllIcons.Actions.ListChanges" />
</group>
<action id="ChangesView.Browse" class="com.intellij.openapi.vcs.changes.actions.BrowseChangesAction"/>
<action id="ChangesView.Browse" class="com.intellij.openapi.vcs.changes.committed.BrowseCommittedChangesAction"/>
<group id="EditorGutterVcsPopupMenu">
<reference ref="Annotate"/>
@@ -62,13 +62,13 @@ public abstract class AbstractVcsHelper {
public abstract void showChangesListBrowser(@NotNull CommittedChangeList changelist, @Nullable @Nls String title);
public abstract void showChangesBrowser(@NotNull CommittedChangesProvider provider,
@NotNull RepositoryLocation location,
@Nullable @Nls String title,
@Nullable Component parent);
public abstract void showWhatDiffersBrowser(@NotNull Collection<Change> changes, @Nullable @Nls String title);
public abstract void showCommittedChangesBrowser(@NotNull CommittedChangesProvider provider,
@NotNull RepositoryLocation location,
@Nullable @Nls String title,
@Nullable Component parent);
public abstract void openCommittedChangesTab(@NotNull CommittedChangesProvider provider,
@NotNull RepositoryLocation location,
@NotNull ChangeBrowserSettings settings,
@@ -1,5 +1,5 @@
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.vcs.changes.actions;
package com.intellij.openapi.vcs.changes.committed;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
@@ -13,10 +13,6 @@ import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.AbstractVcsHelper;
import com.intellij.openapi.vcs.CommittedChangesProvider;
import com.intellij.openapi.vcs.RepositoryLocation;
import com.intellij.openapi.vcs.changes.committed.CommittedChangesCache;
import com.intellij.openapi.vcs.changes.committed.CommittedChangesFilterDialog;
import com.intellij.openapi.vcs.changes.committed.CommittedChangesViewManager;
import com.intellij.openapi.vcs.changes.committed.RepositoryLocationCache;
import com.intellij.openapi.vcs.versionBrowser.ChangeBrowserSettings;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.vcsUtil.VcsUtil;
@@ -30,7 +26,7 @@ import static com.intellij.openapi.vcs.changes.ChangesUtil.getVcsForFile;
import static com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier.showOverVersionControlView;
import static com.intellij.util.ObjectUtils.notNull;
public class BrowseChangesAction extends AnAction implements DumbAware {
public class BrowseCommittedChangesAction extends AnAction implements DumbAware {
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
Project project = e.getRequiredData(CommonDataKeys.PROJECT);
@@ -412,10 +412,23 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper {
}
@Override
public void showChangesBrowser(@NotNull CommittedChangesProvider provider,
@NotNull RepositoryLocation location,
@Nullable @Nls String title,
@Nullable Component parent) {
@NotNull
public List<VirtualFile> showMergeDialog(@NotNull List<? extends VirtualFile> files,
@NotNull MergeProvider provider,
@NotNull MergeDialogCustomizer mergeDialogCustomizer) {
if (files.isEmpty()) return Collections.emptyList();
VfsUtil.markDirtyAndRefresh(false, false, false, files.toArray(VirtualFile.EMPTY_ARRAY));
final MultipleFileMergeDialog fileMergeDialog = new MultipleFileMergeDialog(myProject, files, provider, mergeDialogCustomizer);
AppIcon.getInstance().requestAttention(myProject, true);
fileMergeDialog.show();
return fileMergeDialog.getProcessedFiles();
}
@Override
public void showCommittedChangesBrowser(@NotNull CommittedChangesProvider provider,
@NotNull RepositoryLocation location,
@Nullable @Nls String title,
@Nullable Component parent) {
ChangesBrowserSettingsEditor filterUI = provider.createFilterUI(true);
CommittedChangesFilterDialog filterDialog = new CommittedChangesFilterDialog(myProject, filterUI, provider.createDefaultSettings());
@@ -459,19 +472,6 @@ public class AbstractVcsHelperImpl extends AbstractVcsHelper {
}
}
@Override
@NotNull
public List<VirtualFile> showMergeDialog(@NotNull List<? extends VirtualFile> files,
@NotNull MergeProvider provider,
@NotNull MergeDialogCustomizer mergeDialogCustomizer) {
if (files.isEmpty()) return Collections.emptyList();
VfsUtil.markDirtyAndRefresh(false, false, false, files.toArray(VirtualFile.EMPTY_ARRAY));
final MultipleFileMergeDialog fileMergeDialog = new MultipleFileMergeDialog(myProject, files, provider, mergeDialogCustomizer);
AppIcon.getInstance().requestAttention(myProject, true);
fileMergeDialog.show();
return fileMergeDialog.getProcessedFiles();
}
@Override
public void openCommittedChangesTab(@NotNull CommittedChangesProvider provider,
@NotNull RepositoryLocation location,
@@ -1,4 +1,4 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.cvsSupport2.cvsBrowser.ui;
import com.intellij.CvsBundle;
@@ -79,7 +79,7 @@ public class BrowserPanel extends JPanel implements DataProvider, CvsTabbedWindo
result.add(new MyCheckoutAction());
result.add(new MyHistoryAction());
result.add(new MyAnnotateAction());
result.add(new BrowseChangesAction());
result.add(new BrowseCommittedChangesAction());
return result;
}
@@ -199,7 +199,7 @@ public class BrowserPanel extends JPanel implements DataProvider, CvsTabbedWindo
try {
final CvsVcs2 vcs = CvsVcs2.getInstance(myProject);
final FileAnnotation annotation = vcs
.createAnnotation(vcsVirtualFile, vcsVirtualFile.getRevision(), myCvsRootConfiguration);
.createAnnotation(vcsVirtualFile, vcsVirtualFile.getRevision(), myCvsRootConfiguration);
AbstractVcsHelper.getInstance(myProject).showAnnotation(annotation, vcsVirtualFile, vcs);
}
catch (VcsException e1) {
@@ -208,8 +208,8 @@ public class BrowserPanel extends JPanel implements DataProvider, CvsTabbedWindo
}
}
private class BrowseChangesAction extends AnAction implements DumbAware {
BrowseChangesAction() {
private class BrowseCommittedChangesAction extends AnAction implements DumbAware {
BrowseCommittedChangesAction() {
super(VcsBundle.message("browse.changes.action"), "", AllIcons.Actions.Preview);
}
@@ -217,11 +217,12 @@ public class BrowserPanel extends JPanel implements DataProvider, CvsTabbedWindo
public void actionPerformed(@NotNull AnActionEvent e) {
CvsElement[] currentSelection = myTree.getCurrentSelection();
assert currentSelection.length == 1;
final String moduleName = currentSelection [0].getElementPath();
final String moduleName = currentSelection[0].getElementPath();
final CvsRepositoryLocation location = new CvsRepositoryLocation(null, myCvsRootConfiguration, moduleName);
AbstractVcsHelper.getInstance(myProject).showChangesBrowser(CvsVcs2.getInstance(myProject).getCommittedChangesProvider(),
location,
VcsBundle.message("browse.changes.scope", moduleName), BrowserPanel.this);
AbstractVcsHelper.getInstance(myProject).showCommittedChangesBrowser(
CvsVcs2.getInstance(myProject).getCommittedChangesProvider(), location, VcsBundle.message("browse.changes.scope", moduleName),
BrowserPanel.this
);
}
@Override
@@ -36,7 +36,7 @@ class MockVcsHelper(project: Project) : AbstractVcsHelper(project) {
throw UnsupportedOperationException()
}
override fun showChangesBrowser(provider: CommittedChangesProvider<*, *>, location: RepositoryLocation, title: String?, parent: Component?) {
override fun showCommittedChangesBrowser(provider: CommittedChangesProvider<*, *>, location: RepositoryLocation, title: String?, parent: Component?) {
throw UnsupportedOperationException()
}
@@ -67,14 +67,14 @@ public class HgMockVcsHelper extends AbstractVcsHelper {
}
@Override
public void showChangesBrowser(@NotNull CommittedChangesProvider provider,
@NotNull RepositoryLocation location,
@Nullable @Nls String title,
@Nullable Component parent) {
public void showWhatDiffersBrowser(@NotNull Collection<Change> changes, @Nullable @Nls String title) {
}
@Override
public void showWhatDiffersBrowser(@NotNull Collection<Change> changes, @Nullable @Nls String title) {
public void showCommittedChangesBrowser(@NotNull CommittedChangesProvider provider,
@NotNull RepositoryLocation location,
@Nullable @Nls String title,
@Nullable Component parent) {
}
@Override
@@ -194,7 +194,7 @@ public class RepositoryBrowserDialog extends DialogWrapper {
}
group.add(new CheckoutAction());
group.add(new DiffAction());
group.add(new BrowseChangesAction());
group.add(new BrowseCommittedChangesAction());
group.addSeparator();
group.add(new ImportAction());
group.add(new ExportAction());
@@ -926,8 +926,8 @@ public class RepositoryBrowserDialog extends DialogWrapper {
e.getPresentation().setEnabled(node != null && (node.getSVNDirEntry() == null || node.getSVNDirEntry().isDirectory()) && !isRunning);
}
protected class BrowseChangesAction extends DumbAwareAction {
public BrowseChangesAction() {
protected class BrowseCommittedChangesAction extends DumbAwareAction {
public BrowseCommittedChangesAction() {
super(SvnBundle.message("repository.browser.browse.changes.action"),
SvnBundle.message("repository.browser.browse.changes.description"), null);
}
@@ -939,8 +939,8 @@ public class RepositoryBrowserDialog extends DialogWrapper {
return;
}
Url url = node.getURL();
AbstractVcsHelper.getInstance(myProject).showChangesBrowser(myVCS.getCommittedChangesProvider(), new SvnRepositoryLocation(url),
"Changes in " + url.toString(), null);
AbstractVcsHelper.getInstance(myProject).showCommittedChangesBrowser(
myVCS.getCommittedChangesProvider(), new SvnRepositoryLocation(url), "Changes in " + url.toString(), null);
}
@Override