简体   繁体   English

JGoodies Binding:如何绑定两个 ValueModel?

[英]JGoodies Binding: How to bind two ValueModels?

The simplified case is I have简化的情况是我有

ValueHolder a = new ValueHolder();

ValueHolder b = new ValueHolder();

I am looking for我在寻找

[some JGoodies Class].[method](a,b);

That will connect those ValueModel s and keep them mutually updated这将连接那些ValueModel并保持它们相互更新

I can not find among all static classes like PropertyConnector , Bindings , ObjectBinder etc do not have a method to connect two ValueModels我在所有 static 类(如PropertyConnectorBindingsObjectBinder等)中找不到连接两个 ValueModel 的方法

I am sure I am missing something.我确定我错过了一些东西。

My actual use case a little bit more complicated as I am building a reusable component that has calculated ValueModel and I need for a code that will use it to pass a ValueModel that will be bonded to it so the user will be able to do other complicated things with it.我的实际用例有点复杂,因为我正在构建一个已计算ValueModel的可重用组件,我需要一个代码来使用它来传递将绑定到它的ValueModel ,以便用户能够执行其他复杂的操作事情与它。

The simplest way最简单的方法

PropertyConnector.connect(valueModelA, "value", valueModelB, "value");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM