Search in sources :

Example 26 with BindingBuilder

use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.

the class DBConnectionInfoEditor method initBindings.

protected void initBindings() {
    this.view.setEnabled(false);
    DefaultComboBoxModel adapterModel = new DefaultComboBoxModel(DbAdapterInfo.getStandardAdapters());
    view.getAdapters().setModel(adapterModel);
    view.getAdapters().setSelectedIndex(0);
    BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
    bindings = new ObjectBinding[5];
    bindings[0] = builder.bindToTextField(view.getUserName(), "connectionInfo.userName");
    bindings[1] = builder.bindToTextField(view.getPassword(), "connectionInfo.password");
    bindings[2] = builder.bindToTextField(view.getDriver(), "connectionInfo.jdbcDriver");
    bindings[3] = builder.bindToTextField(view.getUrl(), "connectionInfo.url");
    bindings[4] = builder.bindToComboSelection(view.getAdapters(), "connectionInfo.dbAdapter", "Automatic");
}
Also used : BindingBuilder(org.apache.cayenne.swing.BindingBuilder) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel)

Example 27 with BindingBuilder

use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.

the class DataSourceDuplicator method initBindings.

protected void initBindings() {
    BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
    builder.bindToAction(view.getCancelButton(), "cancelAction()");
    builder.bindToAction(view.getOkButton(), "okAction()");
}
Also used : BindingBuilder(org.apache.cayenne.swing.BindingBuilder)

Example 28 with BindingBuilder

use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.

the class TemplatePreferences method initBindings.

protected void initBindings() {
    BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
    builder.bindToAction(view.getAddButton(), "addTemplateAction()");
    builder.bindToAction(view.getRemoveButton(), "removeTemplateAction()");
    TableBindingBuilder tableBuilder = new TableBindingBuilder(builder);
    tableBuilder.addColumn("Name", "#item.key", String.class, false, "XXXXXXXXXXXXXXX");
    tableBuilder.addColumn("Path", "#item.path", String.class, false, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    tableBuilder.bindToTable(view.getTable(), "templateEntries").updateView();
}
Also used : BindingBuilder(org.apache.cayenne.swing.BindingBuilder) TableBindingBuilder(org.apache.cayenne.swing.TableBindingBuilder) TableBindingBuilder(org.apache.cayenne.swing.TableBindingBuilder)

Example 29 with BindingBuilder

use of org.apache.cayenne.swing.BindingBuilder in project cayenne by apache.

the class ValidationResultBrowser method initController.

protected void initController() {
    BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), this);
    builder.bindToAction(view.getCloseButton(), "closeDialogAction()");
}
Also used : BindingBuilder(org.apache.cayenne.swing.BindingBuilder)

Aggregations

BindingBuilder (org.apache.cayenne.swing.BindingBuilder)29 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)5 TableBindingBuilder (org.apache.cayenne.swing.TableBindingBuilder)4 ComponentAdapter (java.awt.event.ComponentAdapter)3 ComponentEvent (java.awt.event.ComponentEvent)3 Entry (java.util.Map.Entry)3 DataMap (org.apache.cayenne.map.DataMap)3 ProjectController (org.apache.cayenne.modeler.ProjectController)3 DataNodeDisplayEvent (org.apache.cayenne.modeler.event.DataNodeDisplayEvent)3 DataNodeDisplayListener (org.apache.cayenne.modeler.event.DataNodeDisplayListener)3 DataMapDefaults (org.apache.cayenne.modeler.pref.DataMapDefaults)3 ChangeEvent (javax.swing.event.ChangeEvent)2 ChangeListener (javax.swing.event.ChangeListener)2 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 KeyEvent (java.awt.event.KeyEvent)1 KeyListener (java.awt.event.KeyListener)1 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 File (java.io.File)1