use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.
the class GeneratorTabController method initBindings.
protected void initBindings() {
// bind actions
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
builder.bindToAction(view.getGenerationMode(), "updateModeAction()");
CayenneProjectPreferences cayPrPref = application.getCayenneProjectPreferences();
this.preferences = (PreferenceDetail) cayPrPref.getProjectDetailObject(PreferenceDetail.class, getViewPreferences().node("controller"));
if (Util.isEmptyString(preferences.getProperty("mode"))) {
preferences.setProperty("mode", STANDARD_OBJECTS_MODE);
}
builder.bindToComboSelection(view.getGenerationMode(), "preferences.property['mode']").updateView();
updateModeAction();
}
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 DataSourceWizard method initBindings.
protected void initBindings() {
final 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 InferRelationshipsController method initBindings.
protected void initBindings() {
BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
builder.bindToAction(view.getCancelButton(), "cancelAction()");
builder.bindToAction(view.getGenerateButton(), "generateAction()");
builder.bindToAction(this, "entitySelectedAction()", SELECTED_PROPERTY);
builder.bindToAction(view.getStrategyCombo(), "strategyComboAction()");
}
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(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();
});
}
Aggregations