From 7269e8aa557dc333d1ab90b3393d41be0022872e Mon Sep 17 00:00:00 2001 From: Shaverdova Elena Date: Tue, 7 Dec 2010 22:46:22 +0300 Subject: [PATCH] Zend Tool Support changed to Command Line Tool Support; Symfony support added. [reviewed by K. Safonov] --- .../util/ui/ChangesTrackingTableView.java | 35 ++++++++++++++++++- .../util/ui/ValidatingTableEditor.java | 12 ++++++- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/util/ui/ChangesTrackingTableView.java b/platform/platform-impl/src/com/intellij/util/ui/ChangesTrackingTableView.java index e69774c3ee91..6c78b54cccea 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/ChangesTrackingTableView.java +++ b/platform/platform-impl/src/com/intellij/util/ui/ChangesTrackingTableView.java @@ -90,6 +90,9 @@ public abstract class ChangesTrackingTableView extends TableView { else if (component instanceof JComboBox) { return ((JComboBox)component).getSelectedItem(); } + else if (component instanceof JCheckBox) { + return Boolean.valueOf(((JCheckBox)component).isSelected()); + } throw new UnsupportedOperationException("editor control of type " + component.getClass().getName() + " is not supported"); } @@ -128,9 +131,39 @@ public abstract class ChangesTrackingTableView extends TableView { } }); } + else if (component instanceof JCheckBox) { + final ActionListener checkBoxListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + listener.stateChanged(new ChangeEvent(component)); + } + }; + ((JCheckBox)component).addActionListener(checkBoxListener); + Disposer.register(parentDisposable, new Disposable() { + @Override + public void dispose() { + ((JCheckBox)component).removeActionListener(checkBoxListener); + } + }); + } + else if (component instanceof JCheckBox) { + final ActionListener checkBoxListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + listener.stateChanged(new ChangeEvent(component)); + } + }; + ((JCheckBox)component).addActionListener(checkBoxListener); + Disposer.register(parentDisposable, new Disposable() { + @Override + public void dispose() { + ((JCheckBox)component).removeActionListener(checkBoxListener); + } + }); + } else { throw new UnsupportedOperationException("editor control of type " + component.getClass().getName() + " is not supported"); } } -} \ No newline at end of file +} diff --git a/platform/platform-impl/src/com/intellij/util/ui/ValidatingTableEditor.java b/platform/platform-impl/src/com/intellij/util/ui/ValidatingTableEditor.java index 7756ad4ec1ff..b71464a38513 100644 --- a/platform/platform-impl/src/com/intellij/util/ui/ValidatingTableEditor.java +++ b/platform/platform-impl/src/com/intellij/util/ui/ValidatingTableEditor.java @@ -86,6 +86,11 @@ public abstract class ValidatingTableEditor implements ComponentWithEmptyT public int getWidth(JTable table) { return myDelegate.getWidth(table); } + + @Override + public Class getColumnClass() { + return myDelegate.getColumnClass(); + } } private JPanel myContentPane; @@ -118,6 +123,7 @@ public abstract class ValidatingTableEditor implements ComponentWithEmptyT return null; } + @Nullable protected abstract Item createItem(); private class IconColumn extends ColumnInfo implements RowHeightProvider { @@ -225,8 +231,12 @@ public abstract class ValidatingTableEditor implements ComponentWithEmptyT } protected void addItem() { + Item newItem = createItem(); + if (newItem == null) { + return; + } List items = new ArrayList(doGetItems()); - items.add(createItem()); + items.add(newItem); setItems(items);