diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/CommitExecutorWithHelp.java b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/CommitExecutorWithHelp.java deleted file mode 100644 index 124361592741..000000000000 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/CommitExecutorWithHelp.java +++ /dev/null @@ -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(); -} diff --git a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/LocalCommitExecutor.java b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/LocalCommitExecutor.java index e122269f753b..4034944118f4 100644 --- a/platform/vcs-api/src/com/intellij/openapi/vcs/changes/LocalCommitExecutor.java +++ b/platform/vcs-api/src/com/intellij/openapi/vcs/changes/LocalCommitExecutor.java @@ -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 { } diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java index 1744b187e08c..044bf725894a 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java @@ -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 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) {