0
我有一個結合如果引用改變了,我必須再次綁定嗎?
org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${catched}");
org.jdesktop.swingbinding.JListBinding jListBinding = org.jdesktop.swingbinding.SwingBindings.createJListBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, messageCatcher1, eLProperty, jList1);
jListBinding.setDetailBinding(org.jdesktop.beansbinding.ELProperty.create("${message}"));
jListBinding.setSourceNullValue("no value");
bindingGroup.addBinding(jListBinding);
,但在執行代碼的messageCatcher1被分配一個新對象。在我的代碼中:
setMessageCatcher1(
new MessageCatcher(
new Catcher<Message>()
{
Pattern pattern = Pattern.compile(getRegexText());
@Override
public boolean catchMessage(Message m)
{
Matcher matcher = pattern.matcher(m.getMessage());
return matcher.find();
}
},
md.findBySQL(getSQLText())
)
);
如果messageCatcher1被分配了一個新的對象,我必須再次綁定嗎?