IDEA-186564 Default size of Edit configuration -> tasks before launch is just for 1 step

This commit is contained in:
Sergey Malenkov
2018-02-19 13:46:06 +03:00
parent 46de637ee3
commit 94ed9c62ea
@@ -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);