如何在 Javascript 事件上从 JSNI 设置 GWT Class 字段

How to set GWT Class field from JSNI on Javascript event

我有这个 GWT Class 包装了 Shephered Tour Javascript 库:

public class SheperedTour {
    private static boolean started = false;
    private static boolean finished = false;
    private static JavaScriptObject tour;

    public static void startTour(){
        if(!started){
            _startTour();
            started = true;
        }
    }       
    public static native void cancelTour()/*-{
        @com.mycomp.app.client.local.utils.SheperedTour::tour.cancel();
    }-*/;

    public static native void _startTour()/*-{
        tour = new $wnd.Shepherd.Tour({
            defaults: {
                classes: 'shepherd-theme-arrows'
            }
        });
        @com.mycomp.app.client.local.utils.SheperedTour::tour = tour;
        tour.addStep('tour-6', {
            text: 'When done, click this to submit',
            attachTo: '#submit left',
            buttons: [
                {
                    text: 'Finish',
                    action: tour.next
                }
            ]
        });
        tour.start();
    }-*/;
}

我需要完成的是在单击 'Finish' 按钮时设置 finished 静态字段。我怎样才能做到这一点?

单击 "Finish" 按钮时,从 JavaScript(JSNI) 调用 Java 方法,设置完成的静态字段

[instance-expr.]@class-name::field-name//Syntax