Home > Blockchain >  JGoodies Binding: How to bind two ValueModels?
JGoodies Binding: How to bind two ValueModels?

Time:09-04

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 ValueModels and keep them mutually updated

I can not find among all static classes like PropertyConnector, Bindings, ObjectBinder etc do not have a method to connect two ValueModels

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.

CodePudding user response:

The simplest way

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