コード例 #1
0
  private void initListeners(final UnitVmModel model) {
    model
        .getAdvancedMode()
        .getPropertyChangedEvent()
        .addListener(
            new IEventListener<EventArgs>() {

              @Override
              public void eventRaised(
                  Event<? extends EventArgs> ev, Object sender, EventArgs args) {
                storeAdvancedModeToLocalStorage(model);
                swithAccordingToMode(model);
              }
            });

    model
        .getAttachedToInstanceType()
        .getPropertyChangedEvent()
        .addListener(
            new IEventListener<EventArgs>() {
              @Override
              public void eventRaised(
                  Event<? extends EventArgs> ev, Object sender, EventArgs args) {
                swithAttachToInstanceType(model);
              }
            });

    model
        .getValid()
        .getPropertyChangedEvent()
        .addListener(
            new IEventListener<EventArgs>() {
              @Override
              public void eventRaised(
                  Event<? extends EventArgs> ev, Object sender, EventArgs args) {
                switchToAdvancedIfNeeded(model);
              }
            });

    registerHandler(
        getView()
            .getNumaSupportButton()
            .addClickHandler(
                new ClickHandler() {
                  @Override
                  public void onClick(ClickEvent event) {
                    getView().getNumaSupportButton().getCommand().execute();
                  }
                }));
  }
コード例 #2
0
 private void swithAttachToInstanceType(final UnitVmModel model) {
   getView().switchAttachToInstanceType(model.getAttachedToInstanceType().getEntity());
 }