Remove "CommitExecutorWithHelp" - use "HelpIdProvider" instead

This commit is contained in:
Konstantin Kolosovsky
2018-01-30 01:13:45 +03:00
parent 4a8a5b0161
commit 2afd698a97
3 changed files with 6 additions and 34 deletions
@@ -1,26 +0,0 @@
/*
* Copyright 2000-2010 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.vcs.changes;
import org.jetbrains.annotations.NonNls;
/**
* @author irengrig
*/
public interface CommitExecutorWithHelp extends CommitExecutor {
@NonNls
String getHelpId();
}
@@ -15,5 +15,7 @@
*/
package com.intellij.openapi.vcs.changes;
public abstract class LocalCommitExecutor implements CommitExecutorWithHelp {
import com.intellij.ide.HelpIdProvider;
public abstract class LocalCommitExecutor implements CommitExecutor, HelpIdProvider {
}
@@ -3,6 +3,7 @@ package com.intellij.openapi.vcs.changes.ui;
import com.intellij.diff.util.DiffPlaces;
import com.intellij.diff.util.DiffUserDataKeysEx;
import com.intellij.ide.HelpIdProvider;
import com.intellij.ide.ui.UISettings;
import com.intellij.ide.util.PropertiesComponent;
import com.intellij.openapi.Disposable;
@@ -41,6 +42,7 @@ import com.intellij.util.ui.GridBag;
import com.intellij.util.ui.JBDimension;
import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.components.BorderLayoutPanel;
import one.util.streamex.StreamEx;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -463,13 +465,7 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
@Nullable
private static String getHelpId(@NotNull List<CommitExecutor> executors) {
for (CommitExecutor executor : executors) {
if (executor instanceof CommitExecutorWithHelp) {
String helpId = ((CommitExecutorWithHelp)executor).getHelpId();
if (helpId != null) return helpId;
}
}
return null;
return StreamEx.of(executors).select(HelpIdProvider.class).map(HelpIdProvider::getHelpId).nonNull().findFirst().orElse(null);
}
private void setComment(@Nullable LocalChangeList initialSelection, @Nullable String comment) {