Package org.apache.cayenne.swing

Examples of org.apache.cayenne.swing.BindingBuilder


    public GeneratorController(CodeGeneratorControllerBase parent) {
        super(parent);

        createDefaults();
        createView();
        initBindings(new BindingBuilder(getApplication().getBindingFactory(), this));
    }
View Full Code Here


        if (Util.isEmptyString(preferences.getProperty("outputPattern"))) {
            preferences.setProperty("outputPattern", "*.java");
        }

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

        builder.bindToAction(view.getManageTemplatesLink(), "popPreferencesAction()");

        builder.bindToTextField(
                view.getSuperclassPackage(),
                "preferences.superclassPackage").updateView();

        builder.bindToComboSelection(
                view.getGenerationMode(),
                "preferences.property['mode']").updateView();

        builder.bindToComboSelection(
                view.getGeneratorVersion(),
                "preferences.property['version']").updateView();

        builder.bindToStateChange(
                view.getOverwrite(),
                "preferences.booleanProperty['overwrite']").updateView();
        builder
                .bindToStateChange(
                        view.getPairs(),
                        "preferences.booleanProperty['pairs']")
                .updateView();

        builder.bindToStateChange(
                view.getUsePackagePath(),
                "preferences.booleanProperty['usePackagePath']").updateView();

        subTemplate = builder.bindToComboSelection(
                view.getSubclassTemplate(),
                "preferences.subclassTemplate");

        superTemplate = builder.bindToComboSelection(
                view.getSuperclassTemplate(),
                "preferences.superclassTemplate");

        builder.bindToTextField(
                view.getOutputPattern(),
                "preferences.property['outputPattern']").updateView();

        updateTemplates();
    }
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

    }

    protected void initBindings() {

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

        builder.bindToAction(view.getGenerationMode(), "updateModeAction()");

        this.preferences = getViewDomain().getDetail("controller", true);

        if (Util.isEmptyString(preferences.getProperty("mode"))) {
            preferences.setProperty("mode", STANDARD_OBJECTS_MODE);
        }

        builder.bindToComboSelection(
                view.getGenerationMode(),
                "preferences.property['mode']").updateView();

        updateModeAction();
    }
View Full Code Here

    // ------ other stuff ------

    protected void initController() {

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

        builder.bindToAction(view.getCheckAll(), "checkAllAction()");

        TableBindingBuilder tableBuilder = new TableBindingBuilder(builder);

        tableBuilder.addColumn(
                "",
View Full Code Here

    protected DataSourceWizardView createView() {
        return new DataSourceWizardView(this);
    }

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

    }

    // ------ other stuff ------

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

        builder.bindToAction(view.getCheckAll(), "checkAllAction()");
        builder.bindToAction(view.getReverseAll(), "reverseAllAction()");

        TableModel model = new MergerTokenTableModel(this);

        MergeDirection[] dirs = new MergeDirection[] {
                MergeDirection.TO_DB, MergeDirection.TO_MODEL
View Full Code Here

        }
        view.getSourceEntityLabel().setText(attribute.getEntity().getName());

        view.getType().setSelectedItem(attribute.getType());

        BindingBuilder builder = new BindingBuilder(
                getApplication().getBindingFactory(),
                this);
        builder.bindToAction(view.getCancelButton(), "closeAction()");
        builder.bindToAction(view.getSelectPathButton(), "setPath(true)");
        builder.bindToAction(view.getSaveButton(), "saveMapping()");

        /*
         * set filter for ObjAttributePathBrowser
         */
        if (view.getPathBrowser().getModel() == null) {
View Full Code Here

    }

    // ------ other stuff ------

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

        builder.bindToAction(view.getCheckAll(), "checkAllAction()");
        builder.bindToAction(view.getReverseAll(), "reverseAllAction()");

        TableModel model = new MergerTokenTableModel(this);

        MergeDirection[] dirs = new MergeDirection[] {
                MergeDirection.TO_DB, MergeDirection.TO_MODEL
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

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.