enable/disable buttons when selection is changed

This commit is contained in:
nik
2011-09-16 10:43:36 +04:00
parent d25c4a2938
commit 457007ee55
@@ -16,6 +16,8 @@
package com.intellij.ui;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
/**
* @author Konstantin Bulenkov
@@ -27,6 +29,12 @@ class ListToolbarDecorator extends ToolbarDecorator {
myList = list;
myAddActionEnabled = myRemoveActionEnabled = myUpActionEnabled = myDownActionEnabled = true;
createActions();
myList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
updateButtons();
}
});
}
private void createActions() {