diff --git a/platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java b/platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java index bed4a33dcda3..5f5a41729c18 100644 --- a/platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java +++ b/platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java @@ -1,4 +1,4 @@ -// Copyright 2000-2017 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-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. package com.intellij.execution.impl; import com.intellij.execution.BeforeRunTask; @@ -57,27 +57,22 @@ class BeforeRunStepsPanel extends JPanel { myList.getEmptyText().setText(ExecutionBundle.message("before.launch.panel.empty")); myList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); myList.setCellRenderer(new MyListCellRenderer()); + myList.setVisibleRowCount(4); myModel.addListDataListener(new ListDataListener() { @Override public void intervalAdded(ListDataEvent e) { - adjustVisibleRowCount(); updateText(); } @Override public void intervalRemoved(ListDataEvent e) { - adjustVisibleRowCount(); updateText(); } @Override public void contentsChanged(ListDataEvent e) { } - - private void adjustVisibleRowCount() { - myList.setVisibleRowCount(Math.max(4, Math.min(8, myModel.getSize()))); - } }); ToolbarDecorator myDecorator = ToolbarDecorator.createDecorator(myList);