DefaultComboBoxModel adapterModel = new DefaultComboBoxModel(
DbAdapterInfo.getStandardAdapters());
view.getAdapters().setModel(adapterModel);
view.getAdapters().setSelectedIndex(0);
BindingBuilder builder = new BindingBuilder(
getApplication().getBindingFactory(),
this);
sqlBinding = builder.bindToTextArea(view.getSql(), "textForSQL");
adapterBinding = builder.bindToComboSelection(
view.getAdapters(),
"connectionInfo.dbAdapter",
"refreshSQLAction()",
"org.apache.cayenne.dba.JdbcAdapter");
optionBindings = new ObjectBinding[5];
optionBindings[0] = builder.bindToStateChangeAndAction(
view.getCreateFK(),
"generatorDefaults.createFK",
"refreshSQLAction()");
optionBindings[1] = builder.bindToStateChangeAndAction(
view.getCreatePK(),
"generatorDefaults.createPK",
"refreshSQLAction()");
optionBindings[2] = builder.bindToStateChangeAndAction(
view.getCreateTables(),
"generatorDefaults.createTables",
"refreshSQLAction()");
optionBindings[3] = builder.bindToStateChangeAndAction(
view.getDropPK(),
"generatorDefaults.dropPK",
"refreshSQLAction()");
optionBindings[4] = builder.bindToStateChangeAndAction(
view.getDropTables(),
"generatorDefaults.dropTables",
"refreshSQLAction()");
builder.bindToAction(view.getGenerateButton(), "generateSchemaAction()");
builder.bindToAction(view.getSaveSqlButton(), "storeSQLAction()");
builder.bindToAction(view.getCancelButton(), "closeAction()");
// refresh SQL if different tables were selected
view.getTabs().addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {