mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Zend Tool Support changed to Command Line Tool Support; Symfony support added.
[reviewed by K. Safonov]
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user