在 RCPTT 中使用数据绑定时,单击单选按钮不会更新布局

Clicking the radio button is not updating the layout when using databinding in RCPTT

从图中可以看出,Right 按钮已选中,但标签显示 LEFT AREA 应该是 RIGHT AREA

RCPTT 中使用的脚本

get-button Right | click

这是 ui 的示例片段。选中按钮后,将显示一个标签,说明单击了哪个按钮。

DataBindingContext dataBindingContext = new DataBindingContext();

IObservableValue<Boolean> left = new WritableValue<>( true, Boolean.class );
IObservableValue<Boolean> right = new WritableValue<>( false, Boolean.class );

Composite sampleComposite = new Composite( parent, SWT.NONE );
sampleComposite.setLayout( GridLayoutFactory.fillDefaults().numColumns( 2 ).create() );

Button leftBtn = new Button( sampleComposite, SWT.RADIO );
leftBtn.setText( "Left" );
dataBindingContext.bindValue( WidgetProperties.buttonSelection().observe( leftBtn ), left );

Button rightBtn = new Button( sampleComposite, SWT.RADIO );
rightBtn.setText( "Right" );
dataBindingContext.bindValue( WidgetProperties.buttonSelection().observe( rightBtn ), right );

StackLayout stackLayout = new StackLayout();
Composite stackComposite = new Composite( sampleComposite, SWT.NONE );
    stackComposite.setLayout( stackLayout );

Label leftLbl = new Label( stackComposite, SWT.NONE );
leftLbl.setText( "LEFT AREA" );

Label rightLbl = new Label( stackComposite, SWT.NONE );
rightLbl.setText( "RIGHT AREA" );

ISideEffect.create( () -> {
    stackLayout.topControl = left.getValue() ? leftLbl : rightLbl;
    stackComposite.layout();
} );

我能够通过创建我自己的自定义 ecl 命令来解决这个问题,该命令发送 selection 事件并删除 select 同一组合中的每个单选按钮,并且只是 select目标单选按钮。看起来当您使用单击命令

时,aut 没有删除select周围的单选按钮