Package org.apache.cayenne.swing

Examples of org.apache.cayenne.swing.BindingBuilder


               
        initController();
    }
   
    protected void initController() {
        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);
       
        builder.setDelegate(nodeChangeProcessor);
       
        bindings = new ObjectBinding[4];
       
        bindings[0] =
              builder.bindToComboSelection(view.getPasswordEncoder(), "node.dataSource.dataSourceInfo.passwordEncoderClass");
        bindings[1] =
              builder.bindToTextField(view.getPasswordKey(), "node.dataSource.dataSourceInfo.passwordEncoderKey");
        bindings[2] =
              builder.bindToComboSelection(view.getPasswordLocation(), "node.dataSource.dataSourceInfo.passwordLocation");
        bindings[3] =
              builder.bindToTextField(view.getPasswordSource(), "node.dataSource.dataSourceInfo.passwordSource");

          ((ProjectController) getParent())
          .addDataNodeDisplayListener(new DataNodeDisplayListener() {
       
              public void currentDataNodeChanged(DataNodeDisplayEvent e) {
                  refreshView(e.getDataNode());
              }
          });
       
          getView().addComponentListener(new ComponentAdapter() {
       
              public void componentShown(ComponentEvent e) {
                  refreshView(node != null ? node : ((ProjectController) getParent())
                          .getCurrentDataNode());
              }
          });
         
         
     
        builder.bindToAction(view.getPasswordEncoder()"validatePasswordEncoderAction()");
        builder.bindToAction(view.getPasswordLocation(), "passwordLocationChangedAction()");
     
    }
View Full Code Here


        return textForSQL;
    }

    protected void initController() {

        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);

        sqlBinding = builder.bindToTextArea(view.getSql(), "textForSQL");

        /*
         * 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) {
View Full Code Here

        return textForSQL;
    }

    protected void initController() {

        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);

        sqlBinding = builder.bindToTextArea(view.getSql(), "textForSQL");

        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) {
View Full Code Here

        view.getEncodingChoices().setModel(new DefaultComboBoxModel(allEncodings));
        view.getDefaultEncodingLabel().setText("Default (" + systemEncoding + ")");
        view.getDefaultEncoding().setSelected(true);

        // create bindings...
        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);

        this.defaultEncodingBinding = builder
                .bindToStateChange(view.getDefaultEncoding(), "defaultEncoding");

        this.otherEncodingBinding = builder.bindToStateChange(view.getOtherEncoding(),
                "otherEncoding");

        this.selectedEncodingBinding = builder.bindToComboSelection(view
                .getEncodingChoices(), "encoding");
    }
View Full Code Here

    public Component getView() {
        return view;
    }

    protected void initBindings() {
        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);
        builder.bindToAction(view.getAddDataSource(), "newDataSourceAction()");
        builder
                .bindToAction(
                        view.getDuplicateDataSource(),
                        "duplicateDataSourceAction()");
        builder.bindToAction(view.getRemoveDataSource(), "removeDataSourceAction()");
        builder.bindToAction(view.getTestDataSource(), "testDataSourceAction()");

        builder.bindToComboSelection(view.getDataSources(), "dataSourceKey");
    }
View Full Code Here

        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");
    }
View Full Code Here

    public Component getView() {
        return view;
    }

    protected void initBindings() {
        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);
        builder.bindToAction(view.getCancelButton(), "cancelAction()");
        builder.bindToAction(view.getOkButton(), "okAction()");
    }
View Full Code Here

        return path;
    }

    protected void initBindings() {
        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);

        builder.bindToAction(view.getCancelButton(), "cancelAction()");
        builder.bindToAction(view.getOkButton(), "okAction()");

        final FSPath path = getLastTemplateDirectory();
        view.getTemplateChooser().setCurrentDirectory(path.getExistingDirectory(false));
        view.getTemplateChooser().addPropertyChangeListener(
                FileChooser.CURRENT_DIRECTORY_PROPERTY,
View Full Code Here

        // build child controllers...
        EncodingSelector encodingSelector = new EncodingSelector(this, view
                .getEncodingSelector());

        // create bindings...
        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);

        this.saveIntervalBinding = builder.bindToTextField(view.getSaveInterval(),
                "timeInterval");

        this.encodingBinding = builder.bindToProperty(encodingSelector,
                "classGeneratorPreferences.property[\"encoding\"]",
                EncodingSelector.ENCODING_PROPERTY_BINDING);
    }
View Full Code Here

    public Component getView() {
        return view;
    }

    protected void initBindings() {
        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);
        builder.bindToAction(view.getCancelButton(), "cancelAction()");
        builder.bindToAction(view.getOkButton(), "okAction()");
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.swing.BindingBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.