diff: cleanup

This commit is contained in:
Aleksey Pivovarov
2015-10-05 16:19:55 +03:00
parent b6df8b3da8
commit efc550635b
2 changed files with 5 additions and 11 deletions
@@ -19,7 +19,6 @@ import com.intellij.diff.chains.DiffRequestChain;
import com.intellij.diff.chains.DiffRequestProducer;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.JBPopup;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.openapi.ui.popup.PopupStep;
@@ -27,7 +26,6 @@ import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.util.Consumer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
@@ -82,8 +80,7 @@ public class GoToChangePopupBuilder {
protected abstract JBPopup createPopup(@NotNull AnActionEvent e);
}
private static class SimpleGoToChangePopupAction extends BaseGoToChangePopupAction {
private static class SimpleGoToChangePopupAction extends BaseGoToChangePopupAction<DiffRequestChain> {
public SimpleGoToChangePopupAction(@NotNull DiffRequestChain chain, @NotNull Consumer<Integer> onSelected) {
super(chain, onSelected);
}
@@ -91,16 +88,13 @@ public class GoToChangePopupBuilder {
@NotNull
@Override
protected JBPopup createPopup(@NotNull AnActionEvent e) {
return JBPopupFactory.getInstance().createListPopup(new MyListPopupStep(e.getProject()));
return JBPopupFactory.getInstance().createListPopup(new MyListPopupStep());
}
private class MyListPopupStep extends BaseListPopupStep<DiffRequestProducer> {
private final Project myProject;
public MyListPopupStep(@Nullable Project project) {
public MyListPopupStep() {
super("Go To Change", myChain.getRequests());
setDefaultOptionIndex(myChain.getIndex());
myProject = project;
}
@NotNull
@@ -30,7 +30,7 @@ import java.util.List;
public abstract class ChangeGoToChangePopupAction<Chain extends DiffRequestChain>
extends GoToChangePopupBuilder.BaseGoToChangePopupAction<Chain>{
public ChangeGoToChangePopupAction(@NotNull Chain chain, @NotNull Consumer onSelected) {
public ChangeGoToChangePopupAction(@NotNull Chain chain, @NotNull Consumer<Integer> onSelected) {
super(chain, onSelected);
}
@@ -127,7 +127,7 @@ public abstract class ChangeGoToChangePopupAction<Chain extends DiffRequestChain
private final int mySelection;
@SuppressWarnings("AbstractMethodCallInConstructor")
public Fake(@NotNull Chain chain, int selection, @NotNull Consumer onSelected) {
public Fake(@NotNull Chain chain, int selection, @NotNull Consumer<Integer> onSelected) {
super(chain, onSelected);
mySelection = selection;