use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class FilterDialog method initController.
private void initController() {
BindingBuilder builder = new BindingBuilder(eventController.getApplication().getBindingFactory(), this);
builder.bindToStateChange(dbEntity, "dbEntityFilter").updateView();
builder.bindToStateChange(objEntity, "objEntityFilter").updateView();
builder.bindToStateChange(embeddable, "embeddableFilter").updateView();
builder.bindToStateChange(procedure, "procedureFilter").updateView();
builder.bindToStateChange(query, "queryFilter").updateView();
builder.bindToStateChange(all, "allFilter").updateView();
dbEntity.addActionListener(new CheckListener("dbEntity"));
objEntity.addActionListener(new CheckListener("objEntity"));
embeddable.addActionListener(new CheckListener("embeddable"));
procedure.addActionListener(new CheckListener("procedure"));
query.addActionListener(new CheckListener("query"));
all.setEnabled(false);
all.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
dbEntity.setSelected(true);
objEntity.setSelected(true);
embeddable.setSelected(true);
procedure.setSelected(true);
query.setSelected(true);
all.setEnabled(false);
filterController.getTreeModel().setFiltered(filterController.getFilterMap());
filterController.getTree().updateUI();
}
});
}
use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class DataSourceWizard method initBindings.
protected void initBindings() {
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
dataSourceBinding = builder.bindToComboSelection(view.getDataSources(), "dataSourceKey");
builder.bindToAction(view.getCancelButton(), "cancelAction()");
builder.bindToAction(view.getOkButton(), "okAction()");
builder.bindToAction(view.getConfigButton(), "dataSourceConfigAction()");
}
use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class MergerOptions method initController.
protected void initController() {
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
sqlBinding = builder.bindToTextArea(view.getSql(), "textForSQL");
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) {
if (view.getTabs().getSelectedIndex() == 1) {
// this assumes that some tables where checked/unchecked... not very
// efficient
refreshGeneratorAction();
}
}
});
}
use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class DataSourceEditor method initBindings.
protected void initBindings() {
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
builder.setDelegate(nodeChangeProcessor);
prepareBindings(builder);
}
use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class InferRelationshipsTabController method initBindings.
protected void initBindings() {
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
builder.bindToAction(view.getCheckAll(), "checkAllAction()");
TableBindingBuilder tableBuilder = new TableBindingBuilder(builder);
tableBuilder.addColumn("", "parent.setCurrentEntity(#item), selected", Boolean.class, true, Boolean.TRUE);
tableBuilder.addColumn("Source", "#item.getSource().getName()", String.class, false, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
tableBuilder.addColumn("Target", "#item.getTarget().getName()", String.class, false, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
tableBuilder.addColumn("Join", "parent.getJoin(#item)", String.class, false, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
tableBuilder.addColumn("Name", "#item.getName()", String.class, false, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
tableBuilder.addColumn("To Many", "parent.getToMany(#item)", String.class, false, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
this.tableBinding = tableBuilder.bindToTable(view.getTable(), "parent.entities");
}
Aggregations