Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E6739200CAB for ; Sat, 3 Jun 2017 13:36:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E55D3160BCD; Sat, 3 Jun 2017 11:36:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 21E2E160BE2 for ; Sat, 3 Jun 2017 13:36:40 +0200 (CEST) Received: (qmail 81061 invoked by uid 500); 3 Jun 2017 11:36:40 -0000 Mailing-List: contact commits-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cayenne.apache.org Delivered-To: mailing list commits@cayenne.apache.org Received: (qmail 81002 invoked by uid 99); 3 Jun 2017 11:36:40 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Jun 2017 11:36:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 05232E027A; Sat, 3 Jun 2017 11:36:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mgentry@apache.org To: commits@cayenne.apache.org Date: Sat, 03 Jun 2017 11:36:45 -0000 Message-Id: <5f8a836f8ef04d70b3872b0cef0a5b5a@git.apache.org> In-Reply-To: <2acbf5b7672541e099ec041fdd6e760c@git.apache.org> References: <2acbf5b7672541e099ec041fdd6e760c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [7/7] cayenne-modeler git commit: First attempt at using generic bind/unbind mechanism. archived-at: Sat, 03 Jun 2017 11:36:42 -0000 First attempt at using generic bind/unbind mechanism. Project: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/repo Commit: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/commit/1edef7d5 Tree: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/tree/1edef7d5 Diff: http://git-wip-us.apache.org/repos/asf/cayenne-modeler/diff/1edef7d5 Branch: refs/heads/master Commit: 1edef7d5350357be88178022262994f7f127d3cc Parents: 4861004 Author: mrg Authored: Sat Jun 3 07:36:29 2017 -0400 Committer: mrg Committed: Sat Jun 3 07:36:29 2017 -0400 ---------------------------------------------------------------------- .../cayenne/modeler/layout/DataMapLayout.java | 39 +++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cayenne-modeler/blob/1edef7d5/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java b/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java index 1fc8ad5..cb8d9e6 100644 --- a/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java +++ b/src/main/java/org/apache/cayenne/modeler/layout/DataMapLayout.java @@ -20,6 +20,8 @@ package org.apache.cayenne.modeler.layout; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import org.apache.cayenne.modeler.adapters.DataMapAdapter; import org.apache.commons.logging.Log; @@ -45,6 +47,8 @@ public class DataMapLayout private DataMapAdapter dataMapAdapter; + private List> bindings; + public DataMapLayout(final MainWindowSupport parentComponent) throws IOException { super(parentComponent, "/layouts/DataMapLayout.fxml"); @@ -57,20 +61,37 @@ public class DataMapLayout } @Override - public void beginEditing() + public void initializeBindings() { - LOGGER.debug("begin editing " + this); + bindings = new ArrayList<>(); - dataMapNameTextField.textProperty().bindBidirectional(dataMapAdapter.nameProperty()); - quoteSqlIdentifiersCheckBox.selectedProperty().bindBidirectional(dataMapAdapter.quoteSQLIdentifiersProperty()); + bindings.add(new Binding<>(dataMapNameTextField.textProperty(), dataMapAdapter.nameProperty())); + bindings.add(new Binding<>(quoteSqlIdentifiersCheckBox.selectedProperty(), dataMapAdapter.quoteSQLIdentifiersProperty())); } @Override - public void endEditing() + public List> getBindings() { - LOGGER.debug("end editing " + this); - - dataMapNameTextField.textProperty().unbindBidirectional(dataMapAdapter.nameProperty()); - quoteSqlIdentifiersCheckBox.selectedProperty().unbindBidirectional(dataMapAdapter.quoteSQLIdentifiersProperty()); + return bindings; } + +// @Override +// public void beginEditing() +// { +// LOGGER.debug("begin editing " + this); +// +// DetailEditorSupport.super.beginEditing(); +//// dataMapNameTextField.textProperty().bindBidirectional(dataMapAdapter.nameProperty()); +//// quoteSqlIdentifiersCheckBox.selectedProperty().bindBidirectional(dataMapAdapter.quoteSQLIdentifiersProperty()); +// } +// +// @Override +// public void endEditing() +// { +// LOGGER.debug("end editing " + this); +// +// DetailEditorSupport.super.endEditing(); +//// dataMapNameTextField.textProperty().unbindBidirectional(dataMapAdapter.nameProperty()); +//// quoteSqlIdentifiersCheckBox.selectedProperty().unbindBidirectional(dataMapAdapter.quoteSQLIdentifiersProperty()); +// } }