Zend Tool Support changed to Command Line Tool Support; Symfony support added.

[reviewed by K. Safonov]
This commit is contained in:
Shaverdova Elena
2010-12-07 22:50:14 +03:00
parent 59ca1af2f0
commit 7269e8aa55
2 changed files with 45 additions and 2 deletions
@@ -90,6 +90,9 @@ public abstract class ChangesTrackingTableView<T> extends TableView<T> {
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<T> extends TableView<T> {
}
});
}
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");
}
}
}
}
@@ -86,6 +86,11 @@ public abstract class ValidatingTableEditor<Item> 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<Item> implements ComponentWithEmptyT
return null;
}
@Nullable
protected abstract Item createItem();
private class IconColumn extends ColumnInfo<Item, Object> implements RowHeightProvider {
@@ -225,8 +231,12 @@ public abstract class ValidatingTableEditor<Item> implements ComponentWithEmptyT
}
protected void addItem() {
Item newItem = createItem();
if (newItem == null) {
return;
}
List<Item> items = new ArrayList<Item>(doGetItems());
items.add(createItem());
items.add(newItem);
setItems(items);