Search in sources :

Example 16 with BindingBuilder

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

the class ClassesTabController 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.setCurrentClass(#item), selected", Boolean.class, true, Boolean.TRUE);
    tableBuilder.addColumn("Class", "parent.getItemName(#item)", JLabel.class, false, "XXXXXXXXXXXXXX");
    tableBuilder.addColumn("Comments, Warnings", "parent.getProblem(#item)", String.class, false, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    this.tableBinding = tableBuilder.bindToTable(view.getTable(), "parent.classes");
    view.getTable().getColumnModel().getColumn(1).setCellRenderer(new ImageRendererColumn());
}
Also used : BindingBuilder(org.apache.cayenne.swing.BindingBuilder) TableBindingBuilder(org.apache.cayenne.swing.TableBindingBuilder) TableBindingBuilder(org.apache.cayenne.swing.TableBindingBuilder) ImageRendererColumn(org.apache.cayenne.swing.ImageRendererColumn)

Example 17 with BindingBuilder

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

the class ClientModeController method createView.

protected GeneratorControllerPanel createView() {
    this.view = new StandardModePanel();
    Set<Entry<DataMap, DataMapDefaults>> entities = getMapPreferences().entrySet();
    for (Entry<DataMap, DataMapDefaults> entry : entities) {
        StandardPanelComponent dataMapLine = createDataMapLineBy(entry.getKey(), entry.getValue());
        dataMapLine.getDataMapName().setText(dataMapLine.getDataMap().getName());
        BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), dataMapLine);
        builder.bindToTextField(dataMapLine.getSuperclassPackage(), "preferences.superclassPackage").updateView();
        this.view.addDataMapLine(dataMapLine);
    }
    return view;
}
Also used : Entry(java.util.Map.Entry) BindingBuilder(org.apache.cayenne.swing.BindingBuilder) DataMapDefaults(org.apache.cayenne.modeler.pref.DataMapDefaults) DataMap(org.apache.cayenne.map.DataMap)

Example 18 with BindingBuilder

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

the class CodeGeneratorController 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, "classesSelectedAction()", SELECTED_PROPERTY);
    builder.bindToAction(generatorSelector, "generatorSelectedAction()", GeneratorTabController.GENERATOR_PROPERTY);
    generatorSelectedAction();
}
Also used : BindingBuilder(org.apache.cayenne.swing.BindingBuilder)

Example 19 with BindingBuilder

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

the class CustomModeController method createView.

protected GeneratorControllerPanel createView() {
    this.view = new CustomModePanel();
    Set<Entry<DataMap, DataMapDefaults>> entities = getMapPreferences().entrySet();
    for (Entry<DataMap, DataMapDefaults> entry : entities) {
        StandardPanelComponent dataMapLine = createDataMapLineBy(entry.getKey(), entry.getValue());
        dataMapLine.getDataMapName().setText(dataMapLine.getDataMap().getName());
        BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), dataMapLine);
        builder.bindToTextField(dataMapLine.getSuperclassPackage(), "preferences.superclassPackage").updateView();
        this.view.addDataMapLine(dataMapLine);
    }
    return view;
}
Also used : Entry(java.util.Map.Entry) BindingBuilder(org.apache.cayenne.swing.BindingBuilder) DataMapDefaults(org.apache.cayenne.modeler.pref.DataMapDefaults) DataMap(org.apache.cayenne.map.DataMap)

Example 20 with BindingBuilder

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

the class StandardModeController method createView.

protected GeneratorControllerPanel createView() {
    this.view = new StandardModePanel();
    Set<Entry<DataMap, DataMapDefaults>> entities = getMapPreferences().entrySet();
    for (Entry<DataMap, DataMapDefaults> entry : entities) {
        StandardPanelComponent dataMapLine = createDataMapLineBy(entry.getKey(), entry.getValue());
        dataMapLine.getDataMapName().setText(dataMapLine.getDataMap().getName());
        BindingBuilder builder = new BindingBuilder(getApplication().getBindingFactory(), dataMapLine);
        builder.bindToTextField(dataMapLine.getSuperclassPackage(), "preferences.superclassPackage").updateView();
        this.view.addDataMapLine(dataMapLine);
    }
    return view;
}
Also used : Entry(java.util.Map.Entry) BindingBuilder(org.apache.cayenne.swing.BindingBuilder) DataMapDefaults(org.apache.cayenne.modeler.pref.DataMapDefaults) DataMap(org.apache.cayenne.map.DataMap)

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